Compare commits

..

10 Commits

Author SHA1 Message Date
3933df13fb Merge pull request #26 from ldionne/master
Improve support for constexpr in fusion::nil and its iterators.
2014-10-27 22:29:56 +08:00
cdfb1a46b3 Improve support for constexpr in fusion::nil and its iterators. 2014-10-27 10:09:26 -04:00
acf25e3986 Merge pull request #22 from klemensbaum/master
Avoid unused parameter warning in BOOST_FUSION_DEFINE_STRUCT_INLINE
2014-10-20 17:57:59 +08:00
c921b9ca99 Avoid unused parameter warning in BOOST_FUSION_DEFINE_STRUCT_INLINE 2014-10-20 11:48:42 +02:00
6adde75b54 Merge pull request #20 from Flast/hotfix/include-guard-mismatch
Fix include guard mismatch.
2014-10-17 21:14:39 +08:00
1b2e62f4b9 Fix include guard mismatch.
Signed-off-by: Kohei Takahashi <flast@flast.jp>
2014-10-17 18:53:03 +09:00
d0b3d163c5 Merge pull request #19 from mgaunard/master
avoid unused argument warning in map_impl
2014-10-10 06:11:22 +08:00
561b762f57 avoid unused argument warning in map_impl 2014-10-09 14:17:17 +02:00
0eedba5796 Merge pull request #16 from wmamrak/patch-1
Update according to ticket #10403.
2014-08-26 22:29:38 +08:00
0873af5d3c Update according to ticket #10403.
Someone more familiar with this formatting please verify my changes :)
2014-08-26 14:23:32 +02:00
8 changed files with 74 additions and 21 deletions

View File

@ -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]

View File

@ -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(); \
} \

View File

@ -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&) {}
};
}}

View File

@ -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*/)
{}

View File

@ -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

View File

@ -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>

View File

@ -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
View 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();
}