Replacing old style typedefs with new style usings
Change-Id: I85d353708fc431df8312a2337d0508df6aee071f
diff --git a/internal/ceres/accelerate_sparse.h b/internal/ceres/accelerate_sparse.h
index 81f5b94..fdc53e5 100644
--- a/internal/ceres/accelerate_sparse.h
+++ b/internal/ceres/accelerate_sparse.h
@@ -55,18 +55,18 @@
template <>
struct SparseTypesTrait<double> {
- typedef DenseVector_Double DenseVector;
- typedef SparseMatrix_Double SparseMatrix;
- typedef SparseOpaqueSymbolicFactorization SymbolicFactorization;
- typedef SparseOpaqueFactorization_Double NumericFactorization;
+ using DenseVector = DenseVector_Double;
+ using SparseMatrix = SparseMatrix_Double;
+ using SymbolicFactorization = SparseOpaqueSymbolicFactorization;
+ using NumericFactorization = SparseOpaqueFactorization_Double;
};
template <>
struct SparseTypesTrait<float> {
- typedef DenseVector_Float DenseVector;
- typedef SparseMatrix_Float SparseMatrix;
- typedef SparseOpaqueSymbolicFactorization SymbolicFactorization;
- typedef SparseOpaqueFactorization_Float NumericFactorization;
+ using DenseVector = DenseVector_Float;
+ using SparseMatrix = SparseMatrix_Float;
+ using SymbolicFactorization = SparseOpaqueSymbolicFactorization;
+ using NumericFactorization = SparseOpaqueFactorization_Float;
};
template <typename Scalar>
diff --git a/internal/ceres/cost_function_to_functor_test.cc b/internal/ceres/cost_function_to_functor_test.cc
index cf4a57b..3749909 100644
--- a/internal/ceres/cost_function_to_functor_test.cc
+++ b/internal/ceres/cost_function_to_functor_test.cc
@@ -298,20 +298,19 @@
};
// Check that AutoDiff(Functor1) == AutoDiff(CostToFunctor(AutoDiff(Functor1)))
-#define TEST_BODY(Functor1) \
- TEST(CostFunctionToFunctor, Functor1) { \
- typedef AutoDiffCostFunction<Functor1, 2, PARAMETER_BLOCK_SIZES> \
- CostFunction1; \
- typedef CostFunctionToFunctor<2, PARAMETER_BLOCK_SIZES> FunctionToFunctor; \
- typedef AutoDiffCostFunction<FunctionToFunctor, 2, PARAMETER_BLOCK_SIZES> \
- CostFunction2; \
- \
- std::unique_ptr<CostFunction> cost_function(new CostFunction2( \
- new FunctionToFunctor(new CostFunction1(new Functor1)))); \
- \
- std::unique_ptr<CostFunction> actual_cost_function( \
- new CostFunction1(new Functor1)); \
- ExpectCostFunctionsAreEqual(*cost_function, *actual_cost_function); \
+#define TEST_BODY(Functor1) \
+ TEST(CostFunctionToFunctor, Functor1) { \
+ using CostFunction1 = AutoDiffCostFunction<Functor1, 2, PARAMETER_BLOCK_SIZES>; \
+ using FunctionToFunctor = CostFunctionToFunctor<2, PARAMETER_BLOCK_SIZES>; \
+ using CostFunction2 = \
+ AutoDiffCostFunction<FunctionToFunctor, 2, PARAMETER_BLOCK_SIZES>; \
+ \
+ std::unique_ptr<CostFunction> cost_function(new CostFunction2( \
+ new FunctionToFunctor(new CostFunction1(new Functor1)))); \
+ \
+ std::unique_ptr<CostFunction> actual_cost_function( \
+ new CostFunction1(new Functor1)); \
+ ExpectCostFunctionsAreEqual(*cost_function, *actual_cost_function); \
}
#define PARAMETER_BLOCK_SIZES 2
diff --git a/internal/ceres/linear_solver.h b/internal/ceres/linear_solver.h
index 757d01e..413160f 100644
--- a/internal/ceres/linear_solver.h
+++ b/internal/ceres/linear_solver.h
@@ -392,10 +392,10 @@
// Linear solvers that depend on access to the low level structure of
// a SparseMatrix.
// clang-format off
-typedef TypedLinearSolver<BlockSparseMatrix> BlockSparseMatrixSolver; // NOLINT
-typedef TypedLinearSolver<CompressedRowSparseMatrix> CompressedRowSparseMatrixSolver; // NOLINT
-typedef TypedLinearSolver<DenseSparseMatrix> DenseSparseMatrixSolver; // NOLINT
-typedef TypedLinearSolver<TripletSparseMatrix> TripletSparseMatrixSolver; // NOLINT
+using BlockSparseMatrixSolver = TypedLinearSolver<BlockSparseMatrix>; // NOLINT
+using CompressedRowSparseMatrixSolver = TypedLinearSolver<CompressedRowSparseMatrix>; // NOLINT
+using DenseSparseMatrixSolver = TypedLinearSolver<DenseSparseMatrix>; // NOLINT
+using TripletSparseMatrixSolver = TypedLinearSolver<TripletSparseMatrix>; // NOLINT
// clang-format on
} // namespace ceres::internal
diff --git a/internal/ceres/suitesparse.h b/internal/ceres/suitesparse.h
index aeea7b2..e00b82d 100644
--- a/internal/ceres/suitesparse.h
+++ b/internal/ceres/suitesparse.h
@@ -274,7 +274,7 @@
#else // CERES_NO_SUITESPARSE
-typedef void cholmod_factor;
+using cholmod_factor = void;
#include "ceres/internal/disable_warnings.h"