Used Boost.MPL to make the char value from a TypedSymbol available as a type to templated functions/classes

release/4.3a0
Alex Cunningham 2011-02-18 19:57:19 +00:00
parent 02fe443b44
commit 299ce59c61
2 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include <vector>
#include <list>
#include <iostream>
#include <boost/mpl/char.hpp>
#include <boost/format.hpp>
#include <boost/serialization/nvp.hpp>
#ifdef GTSAM_MAGIC_KEY
@ -49,6 +50,7 @@ public:
// typedefs
typedef T Value;
typedef boost::mpl::char_<C> Chr; // to reconstruct the type: use Chr::value
// Constructors:

View File

@ -99,6 +99,13 @@ TEST ( TypedLabledSymbol, encoding ) {
CHECK(assert_equal(key1, RobotKey(act1)));
}
/* ************************************************************************* */
TEST ( TypedLabledSymbol, template_reconstruction ) {
typedef TypedSymbol<Pose3, 'x'> Key;
typedef TypedLabeledSymbol<Key::Value, Key::Chr::value, char> NewKey;
NewKey k(1, 'A');
}
/* ************************************************************************* */
TEST ( Key, keys2symbols )
{