1 /* Copyright 2006-2008 Joaquin M Lopez Munoz.
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
6 * See http://www.boost.org/libs/flyweight for library home page.
9 #ifndef BOOST_FLYWEIGHT_DETAIL_VALUE_TAG_HPP
10 #define BOOST_FLYWEIGHT_DETAIL_VALUE_TAG_HPP
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
17 #include <boost/parameter/parameters.hpp>
18 #include <boost/type_traits/is_base_and_derived.hpp>
26 /* Three ways to indicate that a given class T is a value policy:
27 * 1. Make it derived from value_marker.
28 * 2. Specialize is_value to evaluate to boost::mpl::true_.
29 * 3. Pass it as value<T> when defining a flyweight type.
31 * For the time being the interface of value policies is not public.
34 struct value_marker{};
37 struct is_value:is_base_and_derived<value_marker,T>
40 template<typename T=parameter::void_>
41 struct value:parameter::template_keyword<value<>,T>
44 } /* namespace flyweights::detail */
46 } /* namespace flyweights */
48 } /* namespace boost */