Used Boost.MPL to make the char value from a TypedSymbol available as a type to templated functions/classes
parent
02fe443b44
commit
299ce59c61
|
|
@ -22,6 +22,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <boost/mpl/char.hpp>
|
||||||
#include <boost/format.hpp>
|
#include <boost/format.hpp>
|
||||||
#include <boost/serialization/nvp.hpp>
|
#include <boost/serialization/nvp.hpp>
|
||||||
#ifdef GTSAM_MAGIC_KEY
|
#ifdef GTSAM_MAGIC_KEY
|
||||||
|
|
@ -49,6 +50,7 @@ public:
|
||||||
|
|
||||||
// typedefs
|
// typedefs
|
||||||
typedef T Value;
|
typedef T Value;
|
||||||
|
typedef boost::mpl::char_<C> Chr; // to reconstruct the type: use Chr::value
|
||||||
|
|
||||||
// Constructors:
|
// Constructors:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,13 @@ TEST ( TypedLabledSymbol, encoding ) {
|
||||||
CHECK(assert_equal(key1, RobotKey(act1)));
|
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 )
|
TEST ( Key, keys2symbols )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue