mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-03 06:44:37 +02:00
Merge pull request #13 from brunocodutra/Ticket7769
Fix to Ticket #7769 - @brunocodutra, please watch the test runners, and ping me in a few days. I will merge to master then. Thanks!
This commit is contained in:
@@ -15,9 +15,16 @@
|
||||
// $Revision$
|
||||
|
||||
#include <boost/preprocessor/seq/subseq.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
|
||||
#define BOOST_MPL_PP_RANGE_ITEM(z,n,_) (n)
|
||||
|
||||
#define BOOST_MPL_PP_RANGE(first, length) \
|
||||
BOOST_PP_SEQ_SUBSEQ((0)(1)(2)(3)(4)(5)(6)(7)(8)(9), first, length) \
|
||||
BOOST_PP_SEQ_SUBSEQ( \
|
||||
BOOST_PP_REPEAT(BOOST_PP_ADD(first,length), BOOST_MPL_PP_RANGE_ITEM, _), \
|
||||
first, length \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#endif // BOOST_MPL_AUX_PREPROCESSOR_RANGE_HPP_INCLUDED
|
||||
|
@@ -1,4 +1,5 @@
|
||||
|
||||
compile aux_/increased_arity.cpp ;
|
||||
compile aux_/largest_int.cpp ;
|
||||
compile aux_/msvc_is_class.cpp ;
|
||||
compile aux_/template_arity.cpp ;
|
||||
|
50
test/aux_/increased_arity.cpp
Normal file
50
test/aux_/increased_arity.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
// Copyright Bruno Dutra 2015
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 15
|
||||
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
|
||||
#include <boost/mpl/logical.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/inc.hpp>
|
||||
#include <boost/preprocessor/repeat_from_to.hpp>
|
||||
#include <boost/preprocessor/enum_params.hpp>
|
||||
#include <boost/preprocessor/enum_shifted_params.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
|
||||
#define TEST_N_ARY(unused1, N, unused2) \
|
||||
struct BOOST_PP_CAT(_, BOOST_PP_CAT(N, _ary)) \
|
||||
{ \
|
||||
MPL_ASSERT(( \
|
||||
apply< \
|
||||
and_<BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(N), _)>, \
|
||||
BOOST_PP_ENUM_PARAMS(N, true_ BOOST_PP_INTERCEPT) \
|
||||
> \
|
||||
)); \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
2,
|
||||
BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY),
|
||||
TEST_N_ARY,
|
||||
_
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user