15 #ifndef SERIALBOX_CORE_METAINFOVALUEIMPL_H 16 #define SERIALBOX_CORE_METAINFOVALUEIMPL_H 21 #include <boost/any.hpp> 22 #include <boost/mpl/if.hpp> 23 #include <type_traits> 54 template <class ValueType, class DecayedValueType = typename std::decay<ValueType>::type,
55 class PrimitiveType =
typename MakePrimitive<DecayedValueType>::type,
56 class = typename std::enable_if<
57 !std::is_same<DecayedValueType, MetainfoValueImpl>::value>
::type>
62 any_ = boost::any(DecayedValueType(value));
77 static_assert(
IsSupported<
typename MakePrimitive<T>::type>::value,
78 "ValueType is not supported");
92 any_.swap(other.any_);
93 std::swap(type_, other.type_);
106 boost::any&
any() noexcept {
return any_; }
107 const boost::any&
any()
const noexcept {
return any_; }
114 const T& convert()
const noexcept {
115 return *boost::any_cast<T>(&any_);
std::vector< T > Array
Array class used by serialbox to store meta-information.
Namespace of the serialbox library.
TypeID
Type-id of types recognized by serialbox.
Convert C++ type T to TypeID.
Check if the Type is recognized by serialbox i.e maps to a type-id in TypeID.