diff options
Diffstat (limited to 'boost/functional/factory.hpp')
-rw-r--r-- | boost/functional/factory.hpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/boost/functional/factory.hpp b/boost/functional/factory.hpp index 4aa4267b6a..67fee71d6c 100644 --- a/boost/functional/factory.hpp +++ b/boost/functional/factory.hpp @@ -15,11 +15,14 @@ # include <new> # include <boost/pointee.hpp> -# include <boost/none_t.hpp> # include <boost/get_pointer.hpp> # include <boost/non_type.hpp> # include <boost/type_traits/remove_cv.hpp> +# if defined(BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T) +# include <boost/none_t.hpp> +# endif + # ifndef BOOST_FUNCTIONAL_FACTORY_MAX_ARITY # define BOOST_FUNCTIONAL_FACTORY_MAX_ARITY 10 # elif BOOST_FUNCTIONAL_FACTORY_MAX_ARITY < 3 @@ -35,14 +38,20 @@ namespace boost factory_passes_alloc_to_smart_pointer }; +#if defined(BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T) template< typename Pointer, class Allocator = boost::none_t, factory_alloc_propagation AP = factory_alloc_for_pointee_and_deleter > class factory; +#else + template< typename Pointer, class Allocator = void, + factory_alloc_propagation AP = factory_alloc_for_pointee_and_deleter > + class factory; +#endif //----- ---- --- -- - - - - template< typename Pointer, factory_alloc_propagation AP > - class factory<Pointer, boost::none_t, AP> + class factory<Pointer, void, AP> { public: typedef typename boost::remove_cv<Pointer>::type result_type; @@ -56,6 +65,13 @@ namespace boost # include BOOST_PP_ITERATE() }; +#if defined(BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T) + template< typename Pointer, factory_alloc_propagation AP > + class factory<Pointer, boost::none_t, AP> + : public factory<Pointer, void, AP> + {}; +#endif + template< class Pointer, class Allocator, factory_alloc_propagation AP > class factory : private Allocator::template rebind< typename boost::pointee< |