mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-03 23:04:33 +02:00
makes begin< int_<0> >::type compile
[SVN r33978]
This commit is contained in:
@@ -17,12 +17,30 @@
|
|||||||
#include <boost/mpl/begin_end_fwd.hpp>
|
#include <boost/mpl/begin_end_fwd.hpp>
|
||||||
#include <boost/mpl/sequence_tag_fwd.hpp>
|
#include <boost/mpl/sequence_tag_fwd.hpp>
|
||||||
#include <boost/mpl/void.hpp>
|
#include <boost/mpl/void.hpp>
|
||||||
|
#include <boost/mpl/eval_if.hpp>
|
||||||
|
#include <boost/mpl/aux_/has_begin.hpp>
|
||||||
#include <boost/mpl/aux_/na.hpp>
|
#include <boost/mpl/aux_/na.hpp>
|
||||||
#include <boost/mpl/aux_/traits_lambda_spec.hpp>
|
#include <boost/mpl/aux_/traits_lambda_spec.hpp>
|
||||||
#include <boost/mpl/aux_/config/eti.hpp>
|
#include <boost/mpl/aux_/config/eti.hpp>
|
||||||
|
|
||||||
namespace boost { namespace mpl {
|
namespace boost { namespace mpl {
|
||||||
|
|
||||||
|
|
||||||
|
namespace aux {
|
||||||
|
|
||||||
|
template< typename Sequence >
|
||||||
|
struct begin_type
|
||||||
|
{
|
||||||
|
typedef typename Sequence::begin type;
|
||||||
|
};
|
||||||
|
template< typename Sequence >
|
||||||
|
struct end_type
|
||||||
|
{
|
||||||
|
typedef typename Sequence::end type;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// default implementation; conrete sequences might override it by
|
// default implementation; conrete sequences might override it by
|
||||||
// specializing either the 'begin_impl/end_impl' or the primary
|
// specializing either the 'begin_impl/end_impl' or the primary
|
||||||
// 'begin/end' templates
|
// 'begin/end' templates
|
||||||
@@ -32,7 +50,8 @@ struct begin_impl
|
|||||||
{
|
{
|
||||||
template< typename Sequence > struct apply
|
template< typename Sequence > struct apply
|
||||||
{
|
{
|
||||||
typedef typename Sequence::begin type;
|
typedef typename eval_if<aux::has_begin<Sequence, true_>,
|
||||||
|
aux::begin_type<Sequence>, void_>::type type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -41,7 +60,8 @@ struct end_impl
|
|||||||
{
|
{
|
||||||
template< typename Sequence > struct apply
|
template< typename Sequence > struct apply
|
||||||
{
|
{
|
||||||
typedef typename Sequence::end type;
|
typedef typename eval_if<aux::has_begin<Sequence, true_>,
|
||||||
|
aux::end_type<Sequence>, void_>::type type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user