File indexing completed on 2025-01-18 09:30:53
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_FLYWEIGHT_SET_FACTORY_HPP
0010 #define BOOST_FLYWEIGHT_SET_FACTORY_HPP
0011
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015
0016 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
0017 #include <boost/detail/allocator_utilities.hpp>
0018 #include <boost/flyweight/assoc_container_factory.hpp>
0019 #include <boost/flyweight/factory_tag.hpp>
0020 #include <boost/flyweight/set_factory_fwd.hpp>
0021 #include <boost/mpl/aux_/lambda_support.hpp>
0022 #include <boost/mpl/if.hpp>
0023 #include <set>
0024
0025
0026
0027
0028 namespace boost{
0029
0030 namespace flyweights{
0031
0032 template<
0033 typename Entry,typename Key,
0034 typename Compare,typename Allocator
0035 >
0036 class set_factory_class:
0037 public assoc_container_factory_class<
0038 std::set<
0039 Entry,
0040 typename boost::mpl::if_<
0041 mpl::is_na<Compare>,
0042 std::less<Key>,
0043 Compare
0044 >::type,
0045 typename boost::mpl::if_<
0046 mpl::is_na<Allocator>,
0047 std::allocator<Entry>,
0048 Allocator
0049 >::type
0050 >
0051 >
0052 {
0053 public:
0054 typedef set_factory_class type;
0055 BOOST_MPL_AUX_LAMBDA_SUPPORT(
0056 4,set_factory_class,(Entry,Key,Compare,Allocator))
0057 };
0058
0059
0060
0061 template<
0062 typename Compare,typename Allocator
0063 BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
0064 >
0065 struct set_factory:factory_marker
0066 {
0067 template<typename Entry,typename Key>
0068 struct apply:
0069 mpl::apply2<
0070 set_factory_class<
0071 boost::mpl::_1,boost::mpl::_2,Compare,Allocator
0072 >,
0073 Entry,Key
0074 >
0075 {};
0076 };
0077
0078 }
0079
0080 }
0081
0082 #endif