Chris@16: Chris@16: #ifndef BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED Chris@16: #define BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED Chris@16: Chris@16: // Copyright Aleksey Gurtovoy 2000-2008 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/mpl for documentation. Chris@16: Chris@101: // $Id$ Chris@101: // $Date$ Chris@101: // $Revision$ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: struct has_push_front_arg {}; Chris@16: Chris@16: // agurt 05/feb/04: no default implementation; the stub definition is needed Chris@16: // to enable the default 'has_push_front' implementation below Chris@16: Chris@16: template< typename Tag > Chris@16: struct push_front_impl Chris@16: { Chris@16: template< typename Sequence, typename T > struct apply Chris@16: { Chris@16: // should be instantiated only in the context of 'has_push_front_impl'; Chris@16: // if you've got an assert here, you are requesting a 'push_front' Chris@16: // specialization that doesn't exist. Chris@16: BOOST_MPL_ASSERT_MSG( Chris@16: ( boost::is_same< T, has_push_front_arg >::value ) Chris@16: , REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST Chris@16: , ( Sequence ) Chris@16: ); Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< typename Tag > Chris@16: struct has_push_front_impl Chris@16: { Chris@16: template< typename Seq > struct apply Chris@16: #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING) Chris@16: : aux::has_type< push_front< Seq, has_push_front_arg > > Chris@16: { Chris@16: #else Chris@16: { Chris@16: typedef aux::has_type< push_front< Seq, has_push_front_arg > > type; Chris@16: BOOST_STATIC_CONSTANT(bool, value = Chris@16: (aux::has_type< push_front< Seq, has_push_front_arg > >::value) Chris@16: ); Chris@16: #endif Chris@16: }; Chris@16: }; Chris@16: Chris@16: BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2, push_front_impl) Chris@16: BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1, has_push_front_impl) Chris@16: Chris@16: }} Chris@16: Chris@16: #endif // BOOST_MPL_AUX_PUSH_FRONT_IMPL_HPP_INCLUDED