Added a liberal sprinkling of 'typename' to make TupleConfig work better

release/4.3a0
Alex Cunningham 2010-02-03 13:57:34 +00:00
parent a66a405dd5
commit 94d50ddfb9
2 changed files with 12 additions and 12 deletions

View File

@ -193,12 +193,12 @@ namespace gtsam {
bool exists(const Key1& j) const { return first_.exists(j); } bool exists(const Key1& j) const { return first_.exists(j); }
// access operator - currently configs after the first one will not be found // access operator - currently configs after the first one will not be found
template<class Key, class Value> template<class Key>
const Value& operator[](const Key& j) const { return second_[j]; } const typename Key::Value_t & operator[](const Key& j) const { return second_[j]; }
const Value1& operator[](const Key1& j) const { return first_[j]; } const Value1& operator[](const Key1& j) const { return first_[j]; }
template<class Key, class Value> template<class Key>
const Value& at(const Key& j) const { return second_.at(j); } const typename Key::Value_t & at(const Key& j) const { return second_.at(j); }
const Value1& at(const Key1& j) const { return first_.at(j); } const Value1& at(const Key1& j) const { return first_.at(j); }
}; };

View File

@ -203,12 +203,12 @@ TEST(TupleConfig, create_insert) {
configB.insert(l1, point1); configB.insert(l1, point1);
configB.insert(L1, lam1); configB.insert(L1, lam1);
// bracket operator - FAILS on config types after first one // bracket operator
CHECK(assert_equal(configA[x1], pose1)); CHECK(assert_equal(configA[x1], pose1));
// CHECK(assert_equal(configA[l1], point1)); CHECK(assert_equal(configA[l1], point1));
CHECK(assert_equal(configB[x1], pose1)); CHECK(assert_equal(configB[x1], pose1));
// CHECK(assert_equal(configB[l1], point1)); CHECK(assert_equal(configB[l1], point1));
// CHECK(assert_equal(configB[L1], lam1)); CHECK(assert_equal(configB[L1], lam1));
// exists // exists
CHECK(configA.exists(x1)); CHECK(configA.exists(x1));
@ -217,12 +217,12 @@ TEST(TupleConfig, create_insert) {
CHECK(configB.exists(l1)); CHECK(configB.exists(l1));
CHECK(configB.exists(L1)); CHECK(configB.exists(L1));
// at - access function - FAILS as with bracket operator // at
CHECK(assert_equal(configA.at(x1), pose1)); CHECK(assert_equal(configA.at(x1), pose1));
// CHECK(assert_equal(configA.at(l1), point1)); CHECK(assert_equal(configA.at(l1), point1));
CHECK(assert_equal(configB.at(x1), pose1)); CHECK(assert_equal(configB.at(x1), pose1));
// CHECK(assert_equal(configB.at(l1), point1)); CHECK(assert_equal(configB.at(l1), point1));
// CHECK(assert_equal(configB.at(L1), lam1)); CHECK(assert_equal(configB.at(L1), lam1));
} }