13#ifndef ML_LIGHTWEIGHT_H
14#define ML_LIGHTWEIGHT_H
27#include <boost/ref.hpp>
28#include <boost/tuple/tuple.hpp>
29#include <boost/variant.hpp>
30#include <boost/mpl/contains.hpp>
31#include <boost/mpl/for_each.hpp>
32#include <boost/mpl/less_equal.hpp>
33#include <boost/mpl/integral_c.hpp>
34#include <boost/mpl/vector.hpp>
35#include <boost/mpl/sizeof.hpp>
51 : _value(
new T(value)) {};
61 *_value = *
other._value;
66 *_value = *
other._value;
72 return *_value == *
other._value;
76 return *_value != *
other._value;
82 operator const T&()
const
114 typename boost::mpl::if_<typename boost::mpl::less_equal<boost::mpl::sizeof_<T>, boost::mpl::int_<8>>
::type,
130 return _visitor(
access(value));
138 template <
typename VisitorType,
typename VariantType>
142 return boost::apply_visitor(
lVisitor, value);
wrapper for large objects (i.e.
heap_storage(const SelfType &other)
SelfType & operator=(const SelfType &other)
bool operator==(const SelfType &other) const
SelfType & operator=(const T &other)
heap_storage(const T &value=T())
heap_storage< T > SelfType
bool operator!=(const SelfType &other) const
VisitorType::result_type result_type
lightweight_visitor(VisitorType &visitor)
result_type operator()(T &value)
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define VESSELGRAPH_END_NAMESPACE
#define VESSELGRAPH_BEGIN_NAMESPACE
Namespace lightweight, provides utilities to wrap large objects in a lightweight variant whose static...
VisitorType::result_type apply_visitor(VisitorType &visitor, VariantType &value)
boost::mpl::if_< typenameboost::mpl::less_equal< boost::mpl::sizeof_< T >, boost::mpl::int_< 8 > >::type, T, heap_storage< T > >::type type