diff --git a/gtsam/inference/Factor-inl.h b/gtsam/inference/Factor-inl.h index d05cc1de3..d9fb1e0de 100644 --- a/gtsam/inference/Factor-inl.h +++ b/gtsam/inference/Factor-inl.h @@ -45,12 +45,12 @@ namespace gtsam { void Factor::assertInvariants() const { #ifndef NDEBUG // Check that keys are all unique - std::multiset < KeyType > nonunique(keys_.begin(), keys_.end()); - std::set < KeyType > unique(keys_.begin(), keys_.end()); + std::multiset nonunique(keys_.begin(), keys_.end()); + std::set unique(keys_.begin(), keys_.end()); bool correct = (nonunique.size() == unique.size()) && std::equal(nonunique.begin(), nonunique.end(), unique.begin()); if (!correct) throw std::logic_error( - "Factor::assertInvariants: detected inconsistency"); + "Factor::assertInvariants: Factor contains duplicate keys"); #endif }