forked from boostorg/fusion
Compare commits
10 Commits
boost-1.56
...
boost-1.57
Author | SHA1 | Date | |
---|---|---|---|
3933df13fb | |||
cdfb1a46b3 | |||
acf25e3986 | |||
c921b9ca99 | |||
6adde75b54 | |||
1b2e62f4b9 | |||
d0b3d163c5 | |||
561b762f57 | |||
0eedba5796 | |||
0873af5d3c |
@ -1468,13 +1468,17 @@ rules for __element_conversion__.
|
||||
|
||||
Returns the result type of __make_map__.
|
||||
|
||||
The implementation depends on the support of variadic templates.
|
||||
|
||||
When variadic templates are not supported, make_map is a metafunction of the form:
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <
|
||||
typename K0, typename K1,... typename KN
|
||||
, typename T0, typename T1,... typename TN>
|
||||
struct make_map;
|
||||
|
||||
|
||||
The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements,
|
||||
where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that
|
||||
defaults to `10`. You may define the preprocessor constant
|
||||
@ -1483,6 +1487,18 @@ default. Example:
|
||||
|
||||
#define FUSION_MAX_MAP_SIZE 20
|
||||
|
||||
When variadic templates are supported, make_map is a metafunction class of the form:
|
||||
|
||||
[heading Synopsis]
|
||||
|
||||
template <
|
||||
typename K0, typename K1,... typename KN>
|
||||
struct make_map
|
||||
{
|
||||
struct apply<
|
||||
typename T0, typename T1,... typename TN>
|
||||
};
|
||||
|
||||
[heading Parameters]
|
||||
|
||||
[table
|
||||
@ -1493,9 +1509,16 @@ default. Example:
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
||||
#if !defined(BOOST_FUSION_HAS_VARIADIC_MAP)
|
||||
resulf_of::make_map<K0, K1,... KN, T0, T1,... TN>::type;
|
||||
#else
|
||||
resulf_of::make_map<K0, K1,... KN>::apply<T0, T1,... TN>::type;
|
||||
#endif
|
||||
|
||||
[*Return type]: __result_of_make_map__`<K0, K0,... KN, T0, T1,... TN>::type`
|
||||
[*Return type]: __result_of_make_map__`<K0, K0,... KN, T0, T1,... TN>::type`
|
||||
when variadic templates are not supported, or
|
||||
__result_of_make_map__`<K0, K0,... KN>::apply<T0, T1,... TN>::type`
|
||||
when variadic templates are supported.
|
||||
|
||||
[*Semantics]: A __map__ with __fusion_pair__ elements where the
|
||||
`second_type` is converted following the rules for __element_conversion__.
|
||||
@ -1508,8 +1531,12 @@ default. Example:
|
||||
#include <boost/fusion/include/make_map.hpp>
|
||||
|
||||
[heading Example]
|
||||
|
||||
|
||||
#if !defined(BOOST_FUSION_HAS_VARIADIC_MAP)
|
||||
result_of::make_map<int, double, char, double>::type
|
||||
#else
|
||||
result_of::make_map<int, double>::apply<char, double>::type
|
||||
#endif
|
||||
|
||||
[heading See also]
|
||||
|
||||
|
@ -392,9 +392,9 @@
|
||||
typename boost_fusion_detail_It1::index \
|
||||
>::type type; \
|
||||
\
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
static type call(boost_fusion_detail_It1 const& it1, \
|
||||
boost_fusion_detail_It2 const& it2) \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
static type call(boost_fusion_detail_It1 const& /* it1 */, \
|
||||
boost_fusion_detail_It2 const& /* it2 */) \
|
||||
{ \
|
||||
return type(); \
|
||||
} \
|
||||
|
@ -55,45 +55,45 @@ namespace boost { namespace fusion
|
||||
typedef cons_iterator_identity<
|
||||
add_const<nil_>::type>
|
||||
identity;
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
nil_iterator() {}
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit nil_iterator(nil_ const&) {}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cons_iterator<nil_> : nil_iterator
|
||||
{
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
cons_iterator() {}
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit cons_iterator(nil_ const&) {}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cons_iterator<nil_ const> : nil_iterator
|
||||
{
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
cons_iterator() {}
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit cons_iterator(nil_ const&) {}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cons_iterator<list<> > : nil_iterator
|
||||
{
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
cons_iterator() {}
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit cons_iterator(nil_ const&) {}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cons_iterator<list<> const> : nil_iterator
|
||||
{
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
cons_iterator() {}
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit cons_iterator(nil_ const&) {}
|
||||
};
|
||||
}}
|
||||
|
@ -31,11 +31,11 @@ namespace boost { namespace fusion
|
||||
typedef void_ car_type;
|
||||
typedef void_ cdr_type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
nil_() {}
|
||||
|
||||
template <typename Iterator>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
nil_(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/)
|
||||
{}
|
||||
|
||||
|
@ -38,12 +38,12 @@ namespace boost { namespace fusion { namespace detail
|
||||
|
||||
template <typename Iterator>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
map_impl(Iterator const& iter, map_impl_from_iterator)
|
||||
map_impl(Iterator const&, map_impl_from_iterator)
|
||||
{}
|
||||
|
||||
template <typename Iterator>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
void assign(Iterator const& iter, map_impl_from_iterator)
|
||||
void assign(Iterator const&, map_impl_from_iterator)
|
||||
{}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
|
@ -5,7 +5,7 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#if !defined(BOOST_FUSION_REPETITIVE_REPETITIVE_VIEW_VIEW_HPP_INCLUDED)
|
||||
#ifndef BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
|
||||
#define BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
|
@ -97,6 +97,7 @@ project
|
||||
[ run sequence/map_move.cpp : : : : ]
|
||||
[ run sequence/map_mutate.cpp : : : : ]
|
||||
[ run sequence/map_tie.cpp : : : : ]
|
||||
[ run sequence/nil.cpp : : : : ]
|
||||
[ run sequence/nview.cpp : : : : ]
|
||||
[ run sequence/reverse_view.cpp : : : : ]
|
||||
[ run sequence/segmented_iterator_range.cpp : : : : ]
|
||||
|
25
test/sequence/nil.cpp
Normal file
25
test/sequence/nil.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2014 Louis Dionne
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container/list/cons_iterator.hpp>
|
||||
#include <boost/fusion/container/list/nil.hpp>
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
|
||||
int main() {
|
||||
using namespace boost::fusion;
|
||||
|
||||
// nil should be constexpr constructible
|
||||
{
|
||||
BOOST_CONSTEXPR nil x1 = nil();
|
||||
BOOST_CONSTEXPR nil x2 = nil(nil_iterator(), boost::mpl::true_());
|
||||
(void)x1; (void)x2;
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
Reference in New Issue
Block a user