Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:38

0001 
0002 #ifndef BOOST_MPL_AUX_PUSH_BACK_IMPL_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_PUSH_BACK_IMPL_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2000-2008
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. 
0008 // (See accompanying file LICENSE_1_0.txt or copy at 
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // See http://www.boost.org/libs/mpl for documentation.
0012 
0013 // $Id$
0014 // $Date$
0015 // $Revision$
0016 
0017 #include <boost/mpl/push_back_fwd.hpp>
0018 #include <boost/mpl/assert.hpp>
0019 #include <boost/mpl/aux_/has_type.hpp>
0020 #include <boost/mpl/aux_/traits_lambda_spec.hpp>
0021 #include <boost/mpl/aux_/config/forwarding.hpp>
0022 #include <boost/mpl/aux_/config/static_constant.hpp>
0023 
0024 #include <boost/type_traits/is_same.hpp>
0025 
0026 namespace boost { namespace mpl {
0027 
0028 struct has_push_back_arg {};
0029 
0030 // agurt 05/feb/04: no default implementation; the stub definition is needed 
0031 // to enable the default 'has_push_back' implementation below
0032 template< typename Tag >
0033 struct push_back_impl
0034 {
0035     template< typename Sequence, typename T > struct apply
0036     {
0037         // should be instantiated only in the context of 'has_push_back_impl';
0038         // if you've got an assert here, you are requesting a 'push_back' 
0039         // specialization that doesn't exist.
0040         BOOST_MPL_ASSERT_MSG(
0041               ( boost::is_same< T, has_push_back_arg >::value )
0042             , REQUESTED_PUSH_BACK_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
0043             , ( Sequence )
0044             );
0045     };
0046 };
0047 
0048 template< typename Tag >
0049 struct has_push_back_impl
0050 {
0051     template< typename Seq > struct apply
0052 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
0053         : aux::has_type< push_back< Seq, has_push_back_arg > >
0054     {
0055 #else
0056     {
0057         typedef aux::has_type< push_back< Seq, has_push_back_arg > > type;
0058         BOOST_STATIC_CONSTANT(bool, value = 
0059               (aux::has_type< push_back< Seq, has_push_back_arg > >::value)
0060             );
0061 #endif
0062     };
0063 };
0064 
0065 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2, push_back_impl)
0066 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1, has_push_back_impl)
0067 
0068 }}
0069 
0070 #endif // BOOST_MPL_AUX_PUSH_BACK_IMPL_HPP_INCLUDED