Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62202 - trunk/boost/parameter/aux_
From: andrey.semashev_at_[hidden]
Date: 2010-05-25 11:53:48


Author: andysem
Date: 2010-05-25 11:53:47 EDT (Tue, 25 May 2010)
New Revision: 62202
URL: http://svn.boost.org/trac/boost/changeset/62202

Log:
Decoupled arg_list and maybe. This removes a few dependencies on other headers and speeds up compilation.
Added:
   trunk/boost/parameter/aux_/is_maybe.hpp (contents, props changed)
Text files modified:
   trunk/boost/parameter/aux_/arg_list.hpp | 34 ++++++++++++++--------------------
   trunk/boost/parameter/aux_/maybe.hpp | 11 +++++------
   2 files changed, 19 insertions(+), 26 deletions(-)

Modified: trunk/boost/parameter/aux_/arg_list.hpp
==============================================================================
--- trunk/boost/parameter/aux_/arg_list.hpp (original)
+++ trunk/boost/parameter/aux_/arg_list.hpp 2010-05-25 11:53:47 EDT (Tue, 25 May 2010)
@@ -11,7 +11,7 @@
 #include <boost/parameter/aux_/default.hpp>
 #include <boost/parameter/aux_/parameter_requirements.hpp>
 #include <boost/parameter/aux_/yesno.hpp>
-#include <boost/parameter/aux_/maybe.hpp>
+#include <boost/parameter/aux_/is_maybe.hpp>
 #include <boost/parameter/config.hpp>
 
 #include <boost/mpl/apply.hpp>
@@ -22,12 +22,11 @@
 
 #include <boost/type_traits/add_reference.hpp>
 #include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
 #include <boost/preprocessor/repetition/enum_params.hpp>
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/facilities/intercept.hpp>
 
-namespace boost { namespace parameter {
+namespace boost { namespace parameter {
 
 // Forward declaration for aux::arg_list, below.
 template<class T> struct keyword;
@@ -47,7 +46,7 @@
 // declarations to build member function overload sets that can
 // match against keywords.
 //
-
+
 // MPL sequence support
 struct arg_list_tag;
 
@@ -84,14 +83,14 @@
     template <class KW>
     static no_tag has_key(KW*);
 #endif
-
+
 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
     || (BOOST_WORKAROUND(__GNUC__, < 3)) \
     || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-
+
     // The overload set technique doesn't work with these older
     // compilers, so they need some explicit handholding.
-
+
     // A metafunction class that, given a keyword, returns the type
     // of the base sublist whose get() function can produce the
     // value for that key
@@ -161,11 +160,6 @@
 struct tagged_argument;
 
 template <class T>
-struct is_maybe
- : is_base_and_derived<maybe_base, T>
-{};
-
-template <class T>
 struct get_reference
 {
     typedef typename T::reference type;
@@ -242,8 +236,8 @@
     // same keyword is used again
     static yes_tag has_key(key_type*);
     using Next::has_key;
-
-# define BOOST_PARAMETER_CALL_HAS_KEY(next, key) next::has_key((key*)0)
+
+# define BOOST_PARAMETER_CALL_HAS_KEY(next, key) next::has_key((key*)0)
 # endif
 
     BOOST_MPL_ASSERT_MSG(
@@ -258,7 +252,7 @@
     // specific arguments by name
     //
 
- // Helpers that handle the case when TaggedArg is
+ // Helpers that handle the case when TaggedArg is
     // empty<T>.
     template <class D>
     reference get_default(D const&, mpl::false_) const
@@ -338,7 +332,7 @@
     template <class Default>
     reference get(default_<key_type,Default> const& d) const
     {
- return get_default(d, holds_maybe());
+ return get_default(d, holds_maybe());
     }
 
     template <class Default>
@@ -346,7 +340,7 @@
     {
         return arg.value;
     }
-
+
 #else
 
     reference operator[](keyword<key_type> const&) const
@@ -401,7 +395,7 @@
     // Comma operator to compose argument list without using parameters<>.
     // Useful for argument lists with undetermined length.
     template <class KW, class T2>
- arg_list<tagged_argument<KW, T2>, self>
+ arg_list<tagged_argument<KW, T2>, self>
     operator,(tagged_argument<KW,T2> x) const
     {
         return arg_list<tagged_argument<KW,T2>, self>(x, *this);
@@ -415,7 +409,7 @@
 
 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) // ETI workaround
 template <> struct arg_list<int,int> {};
-#endif
+#endif
 
 // MPL sequence support
 template <class ArgumentPack>
@@ -425,7 +419,7 @@
 
     // The incremented iterator
     typedef arg_list_iterator<typename ArgumentPack::tail_type> next;
-
+
     // dereferencing yields the key type
     typedef typename ArgumentPack::key_type type;
 };

Added: trunk/boost/parameter/aux_/is_maybe.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/parameter/aux_/is_maybe.hpp 2010-05-25 11:53:47 EDT (Tue, 25 May 2010)
@@ -0,0 +1,26 @@
+// Copyright Daniel Wallin, David Abrahams 2010. Use, modification and
+// distribution is subject to 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)
+
+#ifndef BOOST_PARAMETER_IS_MAYBE_050329_HPP
+#define BOOST_PARAMETER_IS_MAYBE_050329_HPP
+
+#include <boost/type_traits/is_base_and_derived.hpp>
+
+namespace boost {
+namespace parameter {
+namespace aux {
+
+struct maybe_base {};
+
+template <class T>
+struct is_maybe
+ : is_base_and_derived<maybe_base, T>
+{};
+
+} // namespace aux
+} // namespace parameter
+} // namespace boost
+
+#endif // BOOST_PARAMETER_IS_MAYBE_050329_HPP

Modified: trunk/boost/parameter/aux_/maybe.hpp
==============================================================================
--- trunk/boost/parameter/aux_/maybe.hpp (original)
+++ trunk/boost/parameter/aux_/maybe.hpp 2010-05-25 11:53:47 EDT (Tue, 25 May 2010)
@@ -16,6 +16,7 @@
 # include <boost/aligned_storage.hpp>
 # include <boost/type_traits/remove_cv.hpp>
 # include <boost/type_traits/add_const.hpp>
+# include <boost/parameter/aux_/is_maybe.hpp>
 
 namespace boost { namespace parameter { namespace aux {
 
@@ -37,23 +38,21 @@
>::type type;
 };
 
-struct maybe_base {};
-
 template <class T>
 struct maybe : maybe_base
 {
     typedef typename add_reference<
 # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
         T const
-# else
+# else
         typename add_const<T>::type
-# endif
+# endif
>::type reference;
-
+
     typedef typename remove_cv<
         BOOST_DEDUCED_TYPENAME remove_reference<reference>::type
>::type non_cv_value;
-
+
     explicit maybe(T value_)
       : value(value_)
       , constructed(false)


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