1 /* Copyright 2006-2009 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_SET_FACTORY_HPP
10 #define BOOST_FLYWEIGHT_SET_FACTORY_HPP
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
17 #include <boost/detail/allocator_utilities.hpp>
18 #include <boost/flyweight/assoc_container_factory.hpp>
19 #include <boost/flyweight/factory_tag.hpp>
20 #include <boost/flyweight/set_factory_fwd.hpp>
21 #include <boost/mpl/aux_/lambda_support.hpp>
22 #include <boost/mpl/if.hpp>
25 /* Particularization of assoc_container_factory_class using a set.
33 typename Entry,typename Key,
34 typename Compare,typename Allocator
36 class set_factory_class:
37 public assoc_container_factory_class<
40 typename boost::mpl::if_<
45 typename boost::mpl::if_<
46 mpl::is_na<Allocator>,
47 std::allocator<Entry>,
54 typedef set_factory_class type;
55 BOOST_MPL_AUX_LAMBDA_SUPPORT(
56 4,set_factory_class,(Entry,Key,Compare,Allocator))
59 /* set_factory_class specifier */
62 typename Compare,typename Allocator
63 BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
65 struct set_factory:factory_marker
67 template<typename Entry,typename Key>
71 boost::mpl::_1,boost::mpl::_2,Compare,Allocator
78 } /* namespace flyweights */
80 } /* namespace boost */