diff --git a/gtsam/discrete/DiscreteKey.h b/gtsam/discrete/DiscreteKey.h index f829e4f7c..3462166f4 100644 --- a/gtsam/discrete/DiscreteKey.h +++ b/gtsam/discrete/DiscreteKey.h @@ -31,7 +31,7 @@ namespace gtsam { * Key type for discrete conditionals * Includes name and cardinality */ - typedef std::pair DiscreteKey; + using DiscreteKey = std::pair; /// DiscreteKeys is a set of keys that can be assembled using the & operator struct DiscreteKeys: public std::vector { @@ -39,13 +39,16 @@ namespace gtsam { // Forward all constructors. using std::vector::vector; + /// Constructor for serialization + GTSAM_EXPORT DiscreteKeys() : std::vector::vector() {} + /// Construct from a key - DiscreteKeys(const DiscreteKey& key) { + GTSAM_EXPORT DiscreteKeys(const DiscreteKey& key) { push_back(key); } /// Construct from a vector of keys - DiscreteKeys(const std::vector& keys) : + GTSAM_EXPORT DiscreteKeys(const std::vector& keys) : std::vector(keys) { }