Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler error with latest compilers. (#1) #2

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sophus/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,22 +210,22 @@ class optional {
explicit operator bool() const { return is_valid_; }

T const* operator->() const {
SOPHUS_ENSURE(is_valid_, "must be valid");
SOPHUS_ENSURE(is_valid_, "%s", "must be valid");
return &type_;
}

T* operator->() {
SOPHUS_ENSURE(is_valid_, "must be valid");
SOPHUS_ENSURE(is_valid_, "%s", "must be valid");
return &type_;
}

T const& operator*() const {
SOPHUS_ENSURE(is_valid_, "must be valid");
SOPHUS_ENSURE(is_valid_, "%s", "must be valid");
return type_;
}

T& operator*() {
SOPHUS_ENSURE(is_valid_, "must be valid");
SOPHUS_ENSURE(is_valid_, "%s", "must be valid");
return type_;
}

Expand Down
2 changes: 1 addition & 1 deletion sophus/se2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ class SE2 : public SE2Base<SE2<Scalar_, Options>> {
/// Precondition: ``i`` must be in 0, 1 or 2.
///
SOPHUS_FUNC static Transformation generator(int i) {
SOPHUS_ENSURE(i >= 0 || i <= 2, "i should be in range [0,2].");
SOPHUS_ENSURE(i >= 0 || i <= 2, "%s", "i should be in range [0,2].");
Tangent e;
e.setZero();
e[i] = Scalar(1);
Expand Down
2 changes: 1 addition & 1 deletion sophus/se3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ class SE3 : public SE3Base<SE3<Scalar_, Options>> {
/// Precondition: ``i`` must be in [0, 5].
///
SOPHUS_FUNC static Transformation generator(int i) {
SOPHUS_ENSURE(i >= 0 && i <= 5, "i should be in range [0,5].");
SOPHUS_ENSURE(i >= 0 && i <= 5, "%s", "i should be in range [0,5].");
Tangent e;
e.setZero();
e[i] = Scalar(1);
Expand Down
2 changes: 1 addition & 1 deletion sophus/so2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class SO2Base {
using std::hypot;
// Avoid under/overflows for higher precision
Scalar length = hypot(unit_complex().x(), unit_complex().y());
SOPHUS_ENSURE(length >= Constants<Scalar>::epsilon(),
SOPHUS_ENSURE(length >= Constants<Scalar>::epsilon(), "%s",
"Complex number should not be close to zero!");
unit_complex_nonconst() /= length;
}
Expand Down
4 changes: 2 additions & 2 deletions sophus/so3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ class SO3 : public SO3Base<SO3<Scalar_, Options>> {
///
SOPHUS_FUNC static SO3<Scalar> expAndTheta(Tangent const& omega,
Scalar* theta) {
SOPHUS_ENSURE(theta != nullptr, "must not be nullptr.");
SOPHUS_ENSURE(theta != nullptr, "%s", "must not be nullptr.");
using std::abs;
using std::cos;
using std::sin;
Expand Down Expand Up @@ -759,7 +759,7 @@ class SO3 : public SO3Base<SO3<Scalar_, Options>> {
/// Precondition: ``i`` must be 0, 1 or 2.
///
SOPHUS_FUNC static Transformation generator(int i) {
SOPHUS_ENSURE(i >= 0 && i <= 2, "i should be in range [0,2].");
SOPHUS_ENSURE(i >= 0 && i <= 2, "%s", "i should be in range [0,2].");
Tangent e;
e.setZero();
e[i] = Scalar(1);
Expand Down
Loading