Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79462 - trunk/boost/container
From: igaztanaga_at_[hidden]
Date: 2012-07-12 19:25:08


Author: igaztanaga
Date: 2012-07-12 19:25:08 EDT (Thu, 12 Jul 2012)
New Revision: 79462
URL: http://svn.boost.org/trac/boost/changeset/79462

Log:
Ticket #7123: Forward declaration for scoped allocator customization traits.
Added:
   trunk/boost/container/scoped_allocator_fwd.hpp (contents, props changed)
Text files modified:
   trunk/boost/container/scoped_allocator.hpp | 42 ---------------------------------------
   1 files changed, 1 insertions(+), 41 deletions(-)

Modified: trunk/boost/container/scoped_allocator.hpp
==============================================================================
--- trunk/boost/container/scoped_allocator.hpp (original)
+++ trunk/boost/container/scoped_allocator.hpp 2012-07-12 19:25:08 EDT (Thu, 12 Jul 2012)
@@ -23,6 +23,7 @@
 
 #include <boost/container/detail/config_begin.hpp>
 #include <boost/container/detail/workaround.hpp>
+#include <boost/container/scoped_allocator_fwd.hpp>
 #include <boost/type_traits/integral_constant.hpp>
 #include <boost/container/allocator_traits.hpp>
 #include <boost/container/detail/type_traits.hpp>
@@ -31,50 +32,9 @@
 #include <boost/container/detail/pair.hpp>
 #include <boost/move/move.hpp>
 
-#if defined(BOOST_NO_VARIADIC_TEMPLATES)
-#include <boost/container/detail/preprocessor.hpp>
-#endif
 
 namespace boost { namespace container {
 
-#if defined(BOOST_CONTAINER_PERFECT_FORWARDING)
-
-#if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
-
-template <typename OuterAlloc, typename ...InnerAllocs>
-class scoped_allocator_adaptor;
-
-#else // #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
-
-template <typename ...InnerAllocs>
-class scoped_allocator_adaptor;
-
-template <typename OuterAlloc, typename ...InnerAllocs>
-class scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>;
-
-#endif // #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
-
-
-#else // #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
-
-template <typename OuterAlloc
-BOOST_PP_ENUM_TRAILING( BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
- , BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT, container_detail::nat)
->
-class scoped_allocator_adaptor;
-
-#endif
-
-//! The allocator_arg_t struct is an empty structure type used as a unique type to
-//! disambiguate constructor and function overloading. Specifically, several types
-//! have constructors with allocator_arg_t as the first argument, immediately followed
-//! by an argument of a type that satisfies the Allocator requirements
-struct allocator_arg_t{};
-
-//! A instance of type allocator_arg_t
-//!
-static const allocator_arg_t allocator_arg = allocator_arg_t();
-
 //! <b>Remark</b>: if a specialization is derived from true_type, indicates that T may be constructed
 //! with an allocator as its last constructor argument. Ideally, all constructors of T (including the
 //! copy and move constructors) should have a variant that accepts a final argument of

Added: trunk/boost/container/scoped_allocator_fwd.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/container/scoped_allocator_fwd.hpp 2012-07-12 19:25:08 EDT (Thu, 12 Jul 2012)
@@ -0,0 +1,83 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_FWD_HPP
+#define BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_FWD_HPP
+
+#if (defined MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+
+#if defined(BOOST_NO_VARIADIC_TEMPLATES)
+#include <boost/container/detail/preprocessor.hpp>
+#include <boost/container/detail/type_traits.hpp>
+#endif
+
+namespace boost { namespace container {
+
+///@cond
+
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+ #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
+
+ template <typename OuterAlloc, typename ...InnerAllocs>
+ class scoped_allocator_adaptor;
+
+ #else // #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
+
+ template <typename ...InnerAllocs>
+ class scoped_allocator_adaptor;
+
+ template <typename OuterAlloc, typename ...InnerAllocs>
+ class scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>;
+
+ #endif // #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
+
+
+#else // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+template <typename OuterAlloc
+BOOST_PP_ENUM_TRAILING( BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT, container_detail::nat)
+>
+class scoped_allocator_adaptor;
+
+#endif
+
+///@endcond
+
+//! The allocator_arg_t struct is an empty structure type used as a unique type to
+//! disambiguate constructor and function overloading. Specifically, several types
+//! have constructors with allocator_arg_t as the first argument, immediately followed
+//! by an argument of a type that satisfies the Allocator requirements
+struct allocator_arg_t{};
+
+//! A instance of type allocator_arg_t
+//!
+static const allocator_arg_t allocator_arg = allocator_arg_t();
+
+template <class T>
+struct constructible_with_allocator_suffix;
+
+template <class T>
+struct constructible_with_allocator_prefix;
+
+template <typename T, typename Alloc>
+struct uses_allocator;
+
+}} // namespace boost { namespace container {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif // BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_FWD_HPP


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk