Sync from trunk (except adapt class)

[SVN r56713]
This commit is contained in:
Joel de Guzman
2009-10-11 16:08:54 +00:00
parent e0a17b552c
commit 7615b492af
12 changed files with 585 additions and 6 deletions

View File

@@ -23,24 +23,22 @@
"boost/fusion/view/nview/detail/nview_impl.hpp")) \
/**/
#include BOOST_PP_ITERATE()
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace fusion { namespace result_of
{
template <typename Sequence
, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, INT_MAX)>
, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, LONG_MAX)>
struct as_nview
{
typedef mpl::vector_c<
int, BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, I)
> index_type;
typedef nview<Sequence, index_type> type;
};
}}}
#include BOOST_PP_ITERATE()
#endif
///////////////////////////////////////////////////////////////////////////////
@@ -50,6 +48,18 @@ namespace boost { namespace fusion { namespace result_of
#define N BOOST_PP_ITERATION()
#if N < FUSION_MAX_VECTOR_SIZE
namespace boost { namespace fusion { namespace result_of
{
template <typename Sequence, BOOST_PP_ENUM_PARAMS(N, int I)>
struct as_nview<Sequence, BOOST_PP_ENUM_PARAMS(N, I)>
{
typedef mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> index_type;
typedef nview<Sequence, index_type> type;
};
}}}
#endif
namespace boost { namespace fusion
{
template<BOOST_PP_ENUM_PARAMS(N, int I), typename Sequence>

View File

@@ -0,0 +1,38 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_NVIEW_SIZE_IMPL_OCT_06_2009_0525PM)
#define FUSION_NVIEW_SIZE_IMPL_OCT_06_2009_0525PM
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
namespace boost { namespace fusion
{
struct nview_tag;
namespace extension
{
template <typename Tag>
struct size_impl;
template <>
struct size_impl<nview_tag>
{
template <typename Sequence>
struct apply
: result_of::distance<
typename result_of::begin<Sequence>::type
, typename result_of::end<Sequence>::type>
{};
};
}
}}
#endif

View File

@@ -13,6 +13,7 @@
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
#include <boost/fusion/view/nview/detail/size_impl.hpp>
#include <boost/fusion/view/nview/detail/begin_impl.hpp>
#include <boost/fusion/view/nview/detail/end_impl.hpp>
#include <boost/fusion/view/nview/detail/deref_impl.hpp>