Boost logo

Boost-Commit :

From: agurtovoy_at_[hidden]
Date: 2008-07-21 04:00:07


Author: agurtovoy
Date: 2008-07-21 04:00:06 EDT (Mon, 21 Jul 2008)
New Revision: 47650
URL: http://svn.boost.org/trac/boost/changeset/47650

Log:
Merge in critical bug fixes from the trunk (r46570, 46546 and 46620)
Text files modified:
   branches/release/boost/mpl/aux_/begin_end_impl.hpp | 4 ++--
   branches/release/boost/mpl/aux_/push_back_impl.hpp | 26 +++++++++++++++++++++-----
   branches/release/boost/mpl/aux_/push_front_impl.hpp | 26 +++++++++++++++++++++-----
   branches/release/boost/mpl/aux_/traits_lambda_spec.hpp | 15 +++++++++++----
   branches/release/boost/mpl/for_each.hpp | 6 +++++-
   branches/release/boost/mpl/min_max.hpp | 8 ++++----
   branches/release/boost/mpl/vector/aux_/front.hpp | 8 ++++----
   branches/release/boost/mpl/zip_view.hpp | 6 +++---
   8 files changed, 71 insertions(+), 28 deletions(-)

Modified: branches/release/boost/mpl/aux_/begin_end_impl.hpp
==============================================================================
--- branches/release/boost/mpl/aux_/begin_end_impl.hpp (original)
+++ branches/release/boost/mpl/aux_/begin_end_impl.hpp 2008-07-21 04:00:06 EDT (Mon, 21 Jul 2008)
@@ -93,8 +93,8 @@
 # undef AUX778076_IMPL_SPEC
 
 
-BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1,begin_impl)
-BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1,end_impl)
+BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(1,begin_impl)
+BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(1,end_impl)
 
 }}
 

Modified: branches/release/boost/mpl/aux_/push_back_impl.hpp
==============================================================================
--- branches/release/boost/mpl/aux_/push_back_impl.hpp (original)
+++ branches/release/boost/mpl/aux_/push_back_impl.hpp 2008-07-21 04:00:06 EDT (Mon, 21 Jul 2008)
@@ -2,7 +2,7 @@
 #ifndef BOOST_MPL_AUX_PUSH_BACK_IMPL_HPP_INCLUDED
 #define BOOST_MPL_AUX_PUSH_BACK_IMPL_HPP_INCLUDED
 
-// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright Aleksey Gurtovoy 2000-2008
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -15,19 +15,35 @@
 // $Revision$
 
 #include <boost/mpl/push_back_fwd.hpp>
+#include <boost/mpl/assert.hpp>
 #include <boost/mpl/aux_/has_type.hpp>
 #include <boost/mpl/aux_/traits_lambda_spec.hpp>
 #include <boost/mpl/aux_/config/forwarding.hpp>
 #include <boost/mpl/aux_/config/static_constant.hpp>
 
+#include <boost/type_traits/is_same.hpp>
+
 namespace boost { namespace mpl {
 
+template< typename Tag >
+struct has_push_back_impl;
+
 // agurt 05/feb/04: no default implementation; the stub definition is needed
 // to enable the default 'has_push_back' implementation below
 template< typename Tag >
 struct push_back_impl
 {
- template< typename Sequence, typename T > struct apply {};
+ template< typename Sequence, typename T > struct apply
+ {
+ // should be instantiated only in the context of 'has_push_back_impl';
+ // if you've got an assert here, you are requesting a 'push_back'
+ // specialization that doesn't exist.
+ BOOST_MPL_ASSERT_MSG(
+ ( boost::is_same< T, has_push_back_impl<T> >::value )
+ , REQUESTED_PUSH_BACK_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
+ , ( Sequence )
+ );
+ };
 };
 
 template< typename Tag >
@@ -35,13 +51,13 @@
 {
     template< typename Seq > struct apply
 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
- : aux::has_type< push_back<Seq,int> >
+ : aux::has_type< push_back< Seq, has_push_back_impl<Tag> > >
     {
 #else
     {
- typedef aux::has_type< push_back<Seq,int> > type;
+ typedef aux::has_type< push_back< Seq, has_push_back_impl<Tag> > > type;
         BOOST_STATIC_CONSTANT(bool, value =
- (aux::has_type< push_back<Seq,int> >::value)
+ (aux::has_type< push_back< Seq, has_push_back_impl<Tag> > >::value)
             );
 #endif
     };

Modified: branches/release/boost/mpl/aux_/push_front_impl.hpp
==============================================================================
--- branches/release/boost/mpl/aux_/push_front_impl.hpp (original)
+++ branches/release/boost/mpl/aux_/push_front_impl.hpp 2008-07-21 04:00:06 EDT (Mon, 21 Jul 2008)
@@ -2,7 +2,7 @@
 #ifndef BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED
 #define BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED
 
-// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright Aleksey Gurtovoy 2000-2008
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -15,20 +15,36 @@
 // $Revision$
 
 #include <boost/mpl/push_front_fwd.hpp>
+#include <boost/mpl/assert.hpp>
 #include <boost/mpl/aux_/has_type.hpp>
 #include <boost/mpl/aux_/traits_lambda_spec.hpp>
 #include <boost/mpl/aux_/config/forwarding.hpp>
 #include <boost/mpl/aux_/config/static_constant.hpp>
 
+#include <boost/type_traits/is_same.hpp>
+
 namespace boost { namespace mpl {
 
+template< typename Tag >
+struct has_push_front_impl;
+
 // agurt 05/feb/04: no default implementation; the stub definition is needed
 // to enable the default 'has_push_front' implementation below
 
 template< typename Tag >
 struct push_front_impl
 {
- template< typename Sequence, typename T > struct apply {};
+ template< typename Sequence, typename T > struct apply
+ {
+ // should be instantiated only in the context of 'has_push_front_impl';
+ // if you've got an assert here, you are requesting a 'push_front'
+ // specialization that doesn't exist.
+ BOOST_MPL_ASSERT_MSG(
+ ( boost::is_same< T, has_push_front_impl<T> >::value )
+ , REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
+ , ( Sequence )
+ );
+ };
 };
 
 template< typename Tag >
@@ -36,13 +52,13 @@
 {
     template< typename Seq > struct apply
 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
- : aux::has_type< push_front<Seq,int> >
+ : aux::has_type< push_front< Seq, has_push_front_impl<Tag> > >
     {
 #else
     {
- typedef aux::has_type< push_front<Seq,int> > type;
+ typedef aux::has_type< push_front< Seq, has_push_front_impl<Tag> > > type;
         BOOST_STATIC_CONSTANT(bool, value =
- (aux::has_type< push_front<Seq,int> >::value)
+ (aux::has_type< push_front< Seq, has_push_front_impl<Tag> > >::value)
             );
 #endif
     };

Modified: branches/release/boost/mpl/aux_/traits_lambda_spec.hpp
==============================================================================
--- branches/release/boost/mpl/aux_/traits_lambda_spec.hpp (original)
+++ branches/release/boost/mpl/aux_/traits_lambda_spec.hpp 2008-07-21 04:00:06 EDT (Mon, 21 Jul 2008)
@@ -2,7 +2,7 @@
 #ifndef BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
 #define BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED
 
-// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright Aleksey Gurtovoy 2000-2008
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -14,17 +14,18 @@
 // $Date$
 // $Revision$
 
+#include <boost/mpl/sequence_tag_fwd.hpp>
 #include <boost/mpl/void.hpp>
 #include <boost/mpl/aux_/preprocessor/params.hpp>
 #include <boost/mpl/aux_/config/lambda.hpp>
 
 #if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
 
-# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) /**/
+# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) /**/
 
 #elif !defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
 
-# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \
+# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
 template<> struct trait<void_> \
 { \
     template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
@@ -35,7 +36,7 @@
 
 #else
 
-# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \
+# define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
 template<> struct trait<void_> \
 { \
     template< BOOST_MPL_PP_PARAMS(i, typename T) > struct apply \
@@ -53,4 +54,10 @@
 
 #endif // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
 
+
+#define BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(i, trait) \
+ BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(i, trait) \
+ template<> struct trait<non_sequence_tag> {}; \
+/**/
+
 #endif // BOOST_MPL_AUX_TRAITS_LAMBDA_SPEC_HPP_INCLUDED

Modified: branches/release/boost/mpl/for_each.hpp
==============================================================================
--- branches/release/boost/mpl/for_each.hpp (original)
+++ branches/release/boost/mpl/for_each.hpp 2008-07-21 04:00:06 EDT (Mon, 21 Jul 2008)
@@ -2,7 +2,7 @@
 #ifndef BOOST_MPL_FOR_EACH_HPP_INCLUDED
 #define BOOST_MPL_FOR_EACH_HPP_INCLUDED
 
-// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright Aleksey Gurtovoy 2000-2008
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -14,12 +14,14 @@
 // $Date$
 // $Revision$
 
+#include <boost/mpl/is_sequence.hpp>
 #include <boost/mpl/begin_end.hpp>
 #include <boost/mpl/apply.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/next_prior.hpp>
 #include <boost/mpl/deref.hpp>
 #include <boost/mpl/identity.hpp>
+#include <boost/mpl/assert.hpp>
 #include <boost/mpl/aux_/unwrap.hpp>
 
 #include <boost/type_traits/is_same.hpp>
@@ -90,6 +92,8 @@
 inline
 void for_each(F f, Sequence* = 0, TransformOp* = 0)
 {
+ BOOST_MPL_ASSERT(( is_sequence<Sequence> ));
+
     typedef typename begin<Sequence>::type first;
     typedef typename end<Sequence>::type last;
 

Modified: branches/release/boost/mpl/min_max.hpp
==============================================================================
--- branches/release/boost/mpl/min_max.hpp (original)
+++ branches/release/boost/mpl/min_max.hpp 2008-07-21 04:00:06 EDT (Mon, 21 Jul 2008)
@@ -1,8 +1,8 @@
 
-#ifndef BOOST_MPL_MAX_HPP_INCLUDED
-#define BOOST_MPL_MAX_HPP_INCLUDED
+#ifndef BOOST_MPL_MIN_MAX_HPP_INCLUDED
+#define BOOST_MPL_MIN_MAX_HPP_INCLUDED
 
-// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright Aleksey Gurtovoy 2000-2008
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -43,4 +43,4 @@
 
 }}
 
-#endif // BOOST_MPL_MAX_HPP_INCLUDED
+#endif // BOOST_MPL_MIN_MAX_HPP_INCLUDED

Modified: branches/release/boost/mpl/vector/aux_/front.hpp
==============================================================================
--- branches/release/boost/mpl/vector/aux_/front.hpp (original)
+++ branches/release/boost/mpl/vector/aux_/front.hpp 2008-07-21 04:00:06 EDT (Mon, 21 Jul 2008)
@@ -1,8 +1,8 @@
 
-#ifndef BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED
-#define BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED
+#ifndef BOOST_MPL_VECTOR_AUX_FRONT_HPP_INCLUDED
+#define BOOST_MPL_VECTOR_AUX_FRONT_HPP_INCLUDED
 
-// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright Aleksey Gurtovoy 2000-2008
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -53,4 +53,4 @@
 
 }}
 
-#endif // BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED
+#endif // BOOST_MPL_VECTOR_AUX_FRONT_HPP_INCLUDED

Modified: branches/release/boost/mpl/zip_view.hpp
==============================================================================
--- branches/release/boost/mpl/zip_view.hpp (original)
+++ branches/release/boost/mpl/zip_view.hpp 2008-07-21 04:00:06 EDT (Mon, 21 Jul 2008)
@@ -37,7 +37,7 @@
     typedef zip_iterator<
           typename transform1<
                 IteratorSeq
- , next<_1>
+ , mpl::next<_1>
>::type
> next;
 };
@@ -48,8 +48,8 @@
 struct zip_view
 {
  private:
- typedef typename transform1< Sequences, begin<_1> >::type first_ones_;
- typedef typename transform1< Sequences, end<_1> >::type last_ones_;
+ typedef typename transform1< Sequences, mpl::begin<_1> >::type first_ones_;
+ typedef typename transform1< Sequences, mpl::end<_1> >::type last_ones_;
     
  public:
     typedef nested_begin_end_tag tag;


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