Chris@16: /* Copyright 2006-2009 Joaquin M Lopez Munoz. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Chris@16: * See http://www.boost.org/libs/flyweight for library home page. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_FLYWEIGHT_SET_FACTORY_HPP Chris@16: #define BOOST_FLYWEIGHT_SET_FACTORY_HPP Chris@16: Chris@101: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include /* keep it first to prevent nasty warns in MSVC */ Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: /* Particularization of assoc_container_factory_class using a set. Chris@16: */ Chris@16: Chris@16: namespace boost{ Chris@16: Chris@16: namespace flyweights{ Chris@16: Chris@16: template< Chris@16: typename Entry,typename Key, Chris@16: typename Compare,typename Allocator Chris@16: > Chris@16: class set_factory_class: Chris@16: public assoc_container_factory_class< Chris@16: std::set< Chris@16: Entry, Chris@16: typename boost::mpl::if_< Chris@16: mpl::is_na, Chris@16: std::less, Chris@16: Compare Chris@16: >::type, Chris@16: typename boost::mpl::if_< Chris@16: mpl::is_na, Chris@16: std::allocator, Chris@16: Allocator Chris@16: >::type Chris@16: > Chris@16: > Chris@16: { Chris@16: public: Chris@16: typedef set_factory_class type; Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT( Chris@16: 4,set_factory_class,(Entry,Key,Compare,Allocator)) Chris@16: }; Chris@16: Chris@16: /* set_factory_class specifier */ Chris@16: Chris@16: template< Chris@16: typename Compare,typename Allocator Chris@16: BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF Chris@16: > Chris@16: struct set_factory:factory_marker Chris@16: { Chris@16: template Chris@16: struct apply: Chris@16: mpl::apply2< Chris@16: set_factory_class< Chris@16: boost::mpl::_1,boost::mpl::_2,Compare,Allocator Chris@16: >, Chris@16: Entry,Key Chris@16: > Chris@16: {}; Chris@16: }; Chris@16: Chris@16: } /* namespace flyweights */ Chris@16: Chris@16: } /* namespace boost */ Chris@16: Chris@16: #endif