diff --git a/gtsam/nonlinear/Key.h b/gtsam/nonlinear/Key.h index ac3a744de..ab54d471f 100644 --- a/gtsam/nonlinear/Key.h +++ b/gtsam/nonlinear/Key.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #ifdef GTSAM_MAGIC_KEY @@ -49,6 +50,7 @@ public: // typedefs typedef T Value; + typedef boost::mpl::char_ Chr; // to reconstruct the type: use Chr::value // Constructors: diff --git a/gtsam/nonlinear/tests/testKey.cpp b/gtsam/nonlinear/tests/testKey.cpp index 1688fb03d..0c56567e8 100644 --- a/gtsam/nonlinear/tests/testKey.cpp +++ b/gtsam/nonlinear/tests/testKey.cpp @@ -99,6 +99,13 @@ TEST ( TypedLabledSymbol, encoding ) { CHECK(assert_equal(key1, RobotKey(act1))); } +/* ************************************************************************* */ +TEST ( TypedLabledSymbol, template_reconstruction ) { + typedef TypedSymbol Key; + typedef TypedLabeledSymbol NewKey; + NewKey k(1, 'A'); +} + /* ************************************************************************* */ TEST ( Key, keys2symbols ) {