diff --git a/gtsam/nonlinear/Values.h b/gtsam/nonlinear/Values.h index 676d30787..16f8eba16 100644 --- a/gtsam/nonlinear/Values.h +++ b/gtsam/nonlinear/Values.h @@ -387,7 +387,7 @@ namespace gtsam { // Count values of given type \c ValueType template - bool count() const { + size_t count() const { size_t i = 0; for (const auto& key_value : *this) { if (dynamic_cast*>(&key_value.value)) diff --git a/gtsam/nonlinear/tests/testValues.cpp b/gtsam/nonlinear/tests/testValues.cpp index 0dee52570..b3c557b32 100644 --- a/gtsam/nonlinear/tests/testValues.cpp +++ b/gtsam/nonlinear/tests/testValues.cpp @@ -384,6 +384,7 @@ TEST(Values, filter) { } EXPECT_LONGS_EQUAL(2, (long)i); EXPECT_LONGS_EQUAL(2, (long)values.count()); + EXPECT_LONGS_EQUAL(2, (long)values.count()); // construct a values with the view Values actualSubValues2(pose_filtered); diff --git a/gtsam/slam/dataset.cpp b/gtsam/slam/dataset.cpp index 4f52f3c40..fbb198265 100644 --- a/gtsam/slam/dataset.cpp +++ b/gtsam/slam/dataset.cpp @@ -880,7 +880,7 @@ bool writeBALfromValues(const string& filename, const SfM_data &data, } } else { cout - << "writeBALfromValues: different number of cameras in SfM_dataValues (#cameras= " + << "writeBALfromValues: different number of cameras in SfM_dataValues (#cameras " << dataValues.number_cameras() << ") and values (#cameras " << nrPoses << ", #poses " << nrCameras << ")!!" << endl;