true type, and is_same
parent
8ecb7d5367
commit
111d911377
|
@ -338,8 +338,8 @@ namespace gtsam {
|
||||||
// supplied \c filter function.
|
// supplied \c filter function.
|
||||||
template<class ValueType>
|
template<class ValueType>
|
||||||
static bool filterHelper(const std::function<bool(Key)> filter, const ConstKeyValuePair& key_value) {
|
static bool filterHelper(const std::function<bool(Key)> filter, const ConstKeyValuePair& key_value) {
|
||||||
// static_assert if ValueType is not Value
|
// static_assert if ValueType is type: Value
|
||||||
static_assert(std::is_same<Value, ValueType>::value, "ValueType must be type: Value");
|
static_assert(!std::is_same<Value, ValueType>::value, "ValueType must not be type: Value to use this filter");
|
||||||
// Filter and check the type
|
// Filter and check the type
|
||||||
return filter(key_value.key) && (dynamic_cast<const GenericValue<ValueType>*>(&key_value.value));
|
return filter(key_value.key) && (dynamic_cast<const GenericValue<ValueType>*>(&key_value.value));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
#include <gtsam_unstable/nonlinear/expressionTesting.h>
|
#include <gtsam_unstable/nonlinear/expressionTesting.h>
|
||||||
#include <CppUnitLite/TestHarness.h>
|
#include <CppUnitLite/TestHarness.h>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
|
||||||
using namespace gtsam;
|
using namespace gtsam;
|
||||||
|
|
||||||
|
@ -46,8 +48,8 @@ struct ProjectionChart {
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
namespace traits {
|
namespace traits {
|
||||||
template<> struct is_chart<ProjectionChart> : public boost::true_type {};
|
template<> struct is_chart<ProjectionChart> : public std::true_type {};
|
||||||
template<> struct dimension<ProjectionChart> : public boost::integral_constant<int, 2> {};
|
template<> struct dimension<ProjectionChart> : public std::integral_constant<int, 2> {};
|
||||||
} // namespace traits
|
} // namespace traits
|
||||||
} // namespace gtsam
|
} // namespace gtsam
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue