mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
[modernize] Use if constexpr in EuclideanManifold constructor
Change-Id: I61d4827d7b04feed369c72db3643afda67ea434e
This commit is contained in:
@@ -245,14 +245,8 @@ class EuclideanManifold final : public Manifold {
|
||||
static_assert(ceres::DYNAMIC == Eigen::Dynamic,
|
||||
"ceres::DYNAMIC needs to be the same as Eigen::Dynamic.");
|
||||
|
||||
EuclideanManifold() : size_{Size} {
|
||||
static_assert(
|
||||
Size != ceres::DYNAMIC,
|
||||
"The size is set to dynamic. Please call the constructor with a size.");
|
||||
}
|
||||
|
||||
explicit EuclideanManifold(int size) : size_(size) {
|
||||
if (Size != ceres::DYNAMIC) {
|
||||
explicit EuclideanManifold(int size = Size) : size_(size) {
|
||||
if constexpr (Size != ceres::DYNAMIC) {
|
||||
CHECK_EQ(Size, size)
|
||||
<< "Specified size by template parameter differs from the supplied "
|
||||
"one.";
|
||||
|
||||
Reference in New Issue
Block a user