Add genericValue() helper

release/4.3a0
Jose Luis Blanco Claraco 2020-07-28 00:19:44 +02:00 committed by Jose Luis Blanco-Claraco
parent 832b420baa
commit c9fb096002
No known key found for this signature in database
GPG Key ID: D443304FBD70A641
1 changed files with 8 additions and 0 deletions

View File

@ -198,4 +198,12 @@ const ValueType& Value::cast() const {
return dynamic_cast<const GenericValue<ValueType>&>(*this).value();
}
/** Functional constructor of GenericValue<T> so T can be automatically deduced
*/
template<class T>
GenericValue<T> genericValue(const T& v) {
return GenericValue<T>(v);
}
} /* namespace gtsam */