From 62d3c6d4266827b251e46f4ec886c42c4ca92388 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sat, 6 Oct 2001 20:28:27 +0000 Subject: [PATCH] Fix for BOOST_NO_STD_ALLOCATOR when std::allocator doesn't even exist [SVN r11349] --- include/boost/function/function_template.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 09050d1..b31921b 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -28,6 +28,13 @@ # define BOOST_FUNCTION_INIT , invoker(0) #endif // BOOST_FUNCTION_USE_VIRTUAL_FUNCTIONS +// Type of the default allocator +#ifndef BOOST_NO_STD_ALLOCATOR +# define BOOST_FUNCTION_DEFAULT_ALLOCATOR std::allocator +#else +# define BOOST_FUNCTION_DEFAULT_ALLOCATOR void +#endif // BOOST_NO_STD_ALLOCATOR + namespace boost { namespace detail { namespace function { @@ -417,7 +424,7 @@ namespace boost { BOOST_FUNCTION_TEMPLATE_PARMS, typename Policy = empty_function_policy, typename Mixin = empty_function_mixin, - typename Allocator = std::allocator + typename Allocator = BOOST_FUNCTION_DEFAULT_ALLOCATOR > class BOOST_FUNCTION_FUNCTION : public function_base, public Mixin { @@ -727,4 +734,5 @@ namespace boost { } // Cleanup after ourselves... +#undef BOOST_FUNCTION_DEFAULT_ALLOCATOR #undef BOOST_FUNCTION_INIT