Skip to content

Commit

Permalink
Merge pull request #968 from borglab/feature/discrete_wrapper_2
Browse files Browse the repository at this point in the history
  • Loading branch information
dellaert authored Dec 16, 2021
2 parents 6bcd129 + 7401b6e commit 93978cf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gtsam/discrete/DiscreteKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ namespace gtsam {
* Key type for discrete conditionals
* Includes name and cardinality
*/
typedef std::pair<Key,size_t> DiscreteKey;
using DiscreteKey = std::pair<Key,size_t>;

/// DiscreteKeys is a set of keys that can be assembled using the & operator
struct DiscreteKeys: public std::vector<DiscreteKey> {

// Forward all constructors.
using std::vector<DiscreteKey>::vector;

/// Get around gcc bug, which does not like above.
DiscreteKeys() {}
/// Constructor for serialization
GTSAM_EXPORT DiscreteKeys() : std::vector<DiscreteKey>::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<DiscreteKey>& keys) :
GTSAM_EXPORT DiscreteKeys(const std::vector<DiscreteKey>& keys) :
std::vector<DiscreteKey>(keys) {
}

Expand Down

0 comments on commit 93978cf

Please sign in to comment.