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_FRONT_IMPL_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_PUSH_FRONT_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_front_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_front_arg {};
0029 
0030 // agurt 05/feb/04: no default implementation; the stub definition is needed 
0031 // to enable the default 'has_push_front' implementation below
0032 
0033 template< typename Tag >
0034 struct push_front_impl
0035 {
0036     template< typename Sequence, typename T > struct apply
0037     {
0038         // should be instantiated only in the context of 'has_push_front_impl';
0039         // if you've got an assert here, you are requesting a 'push_front' 
0040         // specialization that doesn't exist.
0041         BOOST_MPL_ASSERT_MSG(
0042               ( boost::is_same< T, has_push_front_arg >::value )
0043             , REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
0044             , ( Sequence )
0045             );
0046     };
0047 };
0048 
0049 template< typename Tag >
0050 struct has_push_front_impl
0051 {
0052     template< typename Seq > struct apply
0053 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
0054         : aux::has_type< push_front< Seq, has_push_front_arg > >
0055     {
0056 #else
0057     {
0058         typedef aux::has_type< push_front< Seq, has_push_front_arg > > type;
0059         BOOST_STATIC_CONSTANT(bool, value = 
0060               (aux::has_type< push_front< Seq, has_push_front_arg > >::value)
0061             );
0062 #endif
0063     };
0064 };
0065 
0066 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2, push_front_impl)
0067 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1, has_push_front_impl)
0068 
0069 }}
0070 
0071 #endif // BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED