Merge upstream branch 'develop' into more-ci-targets

This commit is contained in:
Kohei Takahashi
2018-04-22 03:41:55 +09:00
21 changed files with 231 additions and 82 deletions

View File

@ -2,6 +2,7 @@
Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden Copyright (C) 2006 Dan Marsden
Copyright (C) 2010 Christopher Schmidt Copyright (C) 2010 Christopher Schmidt
Copyright (C) 2018 Kohei Takahashi
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -20,39 +21,37 @@
] ]
] ]
[def __spirit__ [@http://spirit.sourceforge.net Spirit]] [def __spirit__ [@http://boost-spirit.com/home/ Spirit]]
[def __phoenix__ [@http://www.boost.org/libs/phoenix/index.html Phoenix]] [def __phoenix__ [@http://www.boost.org/libs/phoenix Phoenix]]
[def __mpl__ [@http://www.boost.org/libs/mpl/index.html MPL]] [def __mpl__ [@http://www.boost.org/libs/mpl MPL]]
[def __stl__ [@http://en.wikipedia.org/wiki/Standard_Template_Library STL]] [def __stl__ [@http://en.wikipedia.org/wiki/Standard_Template_Library STL]]
[def __tuple__ [@http://www.boost.org/libs/tuple/doc/tuple_users_guide.html Boost.Tuple]] [def __tuple__ [@http://www.boost.org/libs/tuple Boost.Tuple]]
[def __tr1__tuple__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1403.pdf TR1 Tuple]] [def __tr1__tuple__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1403.pdf TR1 Tuple]]
[def __boost_tools__ [@http://www.boost.org/tools/index.html Boost Tools]] [def __boost_tools__ [@http://www.boost.org/tools/index.html Boost Tools]]
[def __spirit_list__ [@https://lists.sourceforge.net/lists/listinfo/spirit-general Spirit Mailing List]] [def __spirit_list__ [@https://sourceforge.net/projects/spirit/lists/spirit-general Spirit Mailing List]]
[def __spirit_general__ [@news://news.gmane.org/gmane.comp.spirit.general Spirit General NNTP news portal]] [def __list_archive__ [@https://sourceforge.net/p/spirit/mailman/spirit-general/ archive]]
[def __gmane__ [@http://www.gmane.org Gmane]]
[def __mlist_archive__ [@http://news.gmane.org/gmane.comp.parsers.spirit.general]]
[def __jaakko_jarvi__ [@http://www.boost.org/people/jaakko_jarvi.htm Jaakko Jarvi]] [def __jaakko_jarvi__ [@http://www.boost.org/people/jaakko_jarvi.htm Jaakko Jarvi]]
[def __david_abrahams__ [@http://www.boost.org/people/dave_abrahams.htm David Abrahams]] [def __david_abrahams__ [@http://www.boost.org/people/dave_abrahams.htm David Abrahams]]
[def __the_forwarding_problem__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm The Forwarding Problem]] [def __the_forwarding_problem__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm The Forwarding Problem]]
[def __boost_any__ [@http://www.boost.org/doc/html/any.html Boost.Any]] [def __boost_any__ [@http://www.boost.org/libs/any Boost.Any Library]]
[def __new_iterator_concepts__ [@http://www.boost.org/libs/iterator/doc/new-iter-concepts.html New Iterator Concepts]] [def __new_iterator_concepts__ [@http://www.boost.org/libs/iterator/doc/new-iter-concepts.html New Iterator Concepts]]
[def __boost_array_library__ [@http://www.boost.org/doc/html/array.html Boost.Array Library]] [def __boost_array_library__ [@http://www.boost.org/libs/array Boost.Array Library]]
[def __boost_variant_library__ [@http://www.boost.org/doc/html/variant.html Boost.Variant Library]] [def __boost_variant_library__ [@http://www.boost.org/libs/variant Boost.Variant Library]]
[def __boost_tuple_library__ [@http://www.boost.org/libs/tuple/doc/tuple_users_guide.html Boost.Tuple Library]] [def __boost_tuple_library__ [@http://www.boost.org/libs/tuple Boost.Tuple Library]]
[def __boost_ref__ [@http://www.boost.org/doc/html/ref.html Boost.Ref]] [def __boost_ref__ [@http://www.boost.org/libs/core/ref.html Ref utility]]
[def __boost_ref_call__ [@http://www.boost.org/doc/html/ref.html `ref`]] [def __boost_ref_call__ [@http://www.boost.org/libs/core/ref.html `ref`]]
[def __boost_result_of__ [@http://www.boost.org/libs/utility/utility.htm#result_of Boost.ResultOf]] [def __boost_result_of__ [@http://www.boost.org/libs/utility/utility.htm#result_of ResultOf utility]]
[def __boost_result_of_call__ [@http://www.boost.org/libs/utility/utility.htm#result_of `boost::result_of`]] [def __boost_result_of_call__ [@http://www.boost.org/libs/utility/utility.htm#result_of `boost::result_of`]]
[def __boost_enable_if__ [@http://www.boost.org/libs/utility/enable_if.html Boost.EnableIf utility]] [def __boost_enable_if__ [@http://www.boost.org/libs/core/doc/html/core/enable_if.html EnableIf utility]]
[def __boost_shared_ptr_call__ [@http://www.boost.org/libs/smart_ptr/shared_ptr.htm `boost::shared_ptr`]] [def __boost_shared_ptr_call__ [@http://www.boost.org/libs/smart_ptr#shared_ptr `boost::shared_ptr`]]
[def __boost_func_forward__ [@http://www.boost.org/libs/functional/forward/doc/html/index.html Boost.Functional/Forward]] [def __boost_func_forward__ [@http://www.boost.org/libs/functional/forward Boost.Functional/Forward Library]]
[def __boost_func_factory__ [@http://www.boost.org/libs/functional/factory/doc/html/index.html Boost.Functional/Factory]] [def __boost_func_factory__ [@http://www.boost.org/libs/functional/factory Boost.Functional/Factory Library]]
[def __boost_func_hash__ [@http://www.boost.org/doc/html/hash.html Boost.Functional/Hash]] [def __boost_func_hash__ [@http://www.boost.org/doc/html/hash.html Boost.ContainerHash Library]]
[def __std_pair_doc__ [@http://www.sgi.com/tech/stl/pair.html `std::pair`]] [def __std_pair_doc__ [@http://en.cppreference.com/w/cpp/utility/pair `std::pair`]]
[def __std_tuple_doc__ [@http://en.cppreference.com/w/cpp/utility/tuple `std::tuple`]] [def __std_tuple_doc__ [@http://en.cppreference.com/w/cpp/utility/tuple `std::tuple`]]
[def __std_plus_doc__ [@http://www.sgi.com/tech/stl/plus.html `std::plus`]] [def __std_plus_doc__ [@http://en.cppreference.com/w/cpp/utility/functional/plus `std::plus`]]
[def __std_minus_doc__ [@http://www.sgi.com/tech/stl/minus.html `std::minus`]] [def __std_minus_doc__ [@http://en.cppreference.com/w/cpp/utility/functional/minus `std::minus`]]
[def __mpl_integral_constant__ [@http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html MPL Integral Constant]] [def __mpl_integral_constant__ [@http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html MPL Integral Constant]]
[def __mpl_boolean_constant__ [@http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html MPL Boolean Constant]] [def __mpl_boolean_constant__ [@http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html MPL Boolean Constant]]

View File

@ -61,11 +61,8 @@ tool. QuickBook can be found in the __boost_tools__.
[heading Support] [heading Support]
Please direct all questions to Spirit's mailing list. You can subscribe to the Please direct all questions to Spirit's mailing list. You can subscribe to the
__spirit_list__. The mailing list has a searchable archive. A search link to __spirit_list__. The mailing list has a searchable archive. Here is a link to
this archive is provided in __spirit__'s home page. You may also read and post the archives: __list_archive__.
messages to the mailing list through __spirit_general__ (thanks to __gmane__).
The news group mirrors the mailing list. Here is a link to the archives:
__mlist_archive__.
[endsect] [endsect]

View File

@ -1,6 +1,7 @@
[/============================================================================== [/==============================================================================
Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden Copyright (C) 2006 Dan Marsden
Copyright (C) 2018 Kohei Takahashi
Use, modification and distribution is subject to the Boost Software Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -8,20 +9,20 @@
===============================================================================/] ===============================================================================/]
[section References] [section References]
# [@http://boost.org/libs/iterator/doc/new-iter-concepts.html New Iterator Concepts], # [@http://www.boost.org/libs/iterator/doc/new-iter-concepts.html New Iterator Concepts],
David Abrahams, Jeremy Siek, Thomas Witt, 2004-11-01. David Abrahams, Jeremy Siek, Thomas Witt, 2004-11-01.
# [@http://boost.org/libs/tuple/doc/tuple_users_guide.html The Boost Tuple Library], # [@http://www.boost.org/libs/tuple The Boost Tuple Library],
Jaakko Jarvi, 2001. Jaakko Jarvi, 2001.
# [@http://www.boost.org/libs/spirit/ Spirit Parser Library], # [@http://www.boost.org/libs/spirit Spirit Parser Library],
Joel de Guzman, 2001-2006. Joel de Guzman, 2001-2006.
# [@http://www.boost.org/libs/mpl/ The Boost MPL Library], # [@http://www.boost.org/libs/mpl The Boost MPL Library],
Aleksey Gurtovoy and David Abrahams, 2002-2004. Aleksey Gurtovoy and David Abrahams, 2002-2004.
# [@http://www.boost.org/doc/html/array.html Boost Array], # [@http://www.boost.org/libs/array The Boost Array Library],
Nicolai Josuttis, 2002-2004. Nicolai Josuttis, 2002-2004.
# [@http://www.sgi.com/tech/stl/ Standard Template Library Programmer's Guide], # [@http://www.boost.org/libs/core/ref.html Boost.Core / Ref utility],
Hewlett-Packard Company, 1994.
# [@http://www.boost.org/doc/html/ref.html Boost.Ref],
Jaakko Jarvi, Peter Dimov, Douglas Gregor, Dave Abrahams, 1999-2002. Jaakko Jarvi, Peter Dimov, Douglas Gregor, Dave Abrahams, 1999-2002.
# [@http://www.boost.org/libs/hana The Boost Hana Library],
Louis Dionne, 2017.
[endsect] [endsect]

View File

@ -26,7 +26,13 @@ namespace boost { namespace fusion { namespace detail
BOOST_FUSION_BARRIER_BEGIN BOOST_FUSION_BARRIER_BEGIN
template <int size> template <int size>
struct as_deque; struct as_deque
{
BOOST_STATIC_ASSERT_MSG(
size <= FUSION_MAX_DEQUE_SIZE
, "FUSION_MAX_DEQUE_SIZE limit is too low"
);
};
template <> template <>
struct as_deque<0> struct as_deque<0>

View File

@ -25,7 +25,13 @@ namespace boost { namespace fusion { namespace detail
BOOST_FUSION_BARRIER_BEGIN BOOST_FUSION_BARRIER_BEGIN
template <int size, bool is_assoc> template <int size, bool is_assoc>
struct as_map; struct as_map
{
BOOST_STATIC_ASSERT_MSG(
size <= FUSION_MAX_MAP_SIZE
, "FUSION_MAX_MAP_SIZE limit is too low"
);
};
template <bool is_assoc> template <bool is_assoc>
struct as_map<0, is_assoc> struct as_map<0, is_assoc>

View File

@ -125,11 +125,7 @@ namespace boost { namespace fusion { namespace detail
} }
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED
value_type get_val(mpl::identity<key_type>); mpl::identity<value_type> get_val(mpl::identity<key_type>) const;
BOOST_FUSION_GPU_ENABLED
pair_type get_val(mpl::int_<index>);
BOOST_FUSION_GPU_ENABLED
value_type get_val(mpl::identity<key_type>) const;
BOOST_FUSION_GPU_ENABLED BOOST_FUSION_GPU_ENABLED
pair_type get_val(mpl::int_<index>) const; pair_type get_val(mpl::int_<index>) const;

View File

@ -1,5 +1,6 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2013 Joel de Guzman Copyright (c) 2001-2013 Joel de Guzman
Copyright (c) 2018 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -8,10 +9,6 @@
#define BOOST_FUSION_MAP_DETAIL_VALUE_AT_KEY_IMPL_02042013_0821 #define BOOST_FUSION_MAP_DETAIL_VALUE_AT_KEY_IMPL_02042013_0821
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/utility/declval.hpp> #include <boost/utility/declval.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
@ -29,9 +26,9 @@ namespace boost { namespace fusion
template <typename Sequence, typename Key> template <typename Sequence, typename Key>
struct apply struct apply
{ {
typedef typedef typename BOOST_FUSION_IDENTIFIED_TYPE((
decltype(boost::declval<Sequence>().get_val(mpl::identity<Key>())) boost::declval<Sequence>().get_val(mpl::identity<Key>())
type; )) type;
}; };
}; };
} }

View File

@ -25,7 +25,13 @@ namespace boost { namespace fusion { namespace detail
BOOST_FUSION_BARRIER_BEGIN BOOST_FUSION_BARRIER_BEGIN
template <int size> template <int size>
struct as_set; struct as_set
{
BOOST_STATIC_ASSERT_MSG(
size <= FUSION_MAX_SET_SIZE
, "FUSION_MAX_SET_SIZE limit is too low"
);
};
template <> template <>
struct as_set<0> struct as_set<0>

View File

@ -25,7 +25,13 @@ namespace boost { namespace fusion { namespace detail
BOOST_FUSION_BARRIER_BEGIN BOOST_FUSION_BARRIER_BEGIN
template <int size> template <int size>
struct as_vector; struct as_vector
{
BOOST_STATIC_ASSERT_MSG(
size <= FUSION_MAX_VECTOR_SIZE
, "FUSION_MAX_VECTOR_SIZE limit is too low"
);
};
template <> template <>
struct as_vector<0> struct as_vector<0>

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014,2018 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -7,7 +7,6 @@
#ifndef FUSION_VALUE_AT_IMPL_16122014_1641 #ifndef FUSION_VALUE_AT_IMPL_16122014_1641
#define FUSION_VALUE_AT_IMPL_16122014_1641 #define FUSION_VALUE_AT_IMPL_16122014_1641
#include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp> #include <boost/fusion/container/vector/detail/config.hpp>
@ -23,6 +22,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/vector/vector_fwd.hpp> #include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/type_traits/declval.hpp> #include <boost/type_traits/declval.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -35,7 +35,7 @@ namespace boost { namespace fusion
template <std::size_t N, typename U> template <std::size_t N, typename U>
static inline BOOST_FUSION_GPU_ENABLED static inline BOOST_FUSION_GPU_ENABLED
U value_at_impl(store<N, U> const volatile*); mpl::identity<U> value_at_impl(store<N, U> const volatile*);
} }
namespace extension namespace extension
@ -49,9 +49,9 @@ namespace boost { namespace fusion
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct apply struct apply
{ {
typedef typedef typename BOOST_FUSION_IDENTIFIED_TYPE((
decltype(vector_detail::value_at_impl<N::value>(boost::declval<Sequence*>())) vector_detail::value_at_impl<N::value>(boost::declval<Sequence*>())
type; )) type;
}; };
}; };
} }

View File

@ -1,6 +1,6 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Eric Niebler Copyright (c) 2014 Eric Niebler
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014,2018 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -96,4 +96,16 @@ namespace std
#define BOOST_FUSION_CONSTEXPR_THIS BOOST_CONSTEXPR #define BOOST_FUSION_CONSTEXPR_THIS BOOST_CONSTEXPR
#endif #endif
// Workaround for compiler which doesn't compile decltype(expr)::type.
// It expects decltype(expr) deduced as mpl::identity<T>.
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1913))
# include <boost/mpl/identity.hpp>
# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \
boost::mpl::identity<decltype parenthesized_expr>::type::type
#else
# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \
decltype parenthesized_expr ::type
#endif
#endif #endif

View File

@ -13,6 +13,7 @@
#include <boost/mpl/is_sequence.hpp> #include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/and.hpp> #include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp> #include <boost/mpl/not.hpp>
#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace fusion { namespace detail namespace boost { namespace fusion { namespace detail
@ -20,7 +21,7 @@ namespace boost { namespace fusion { namespace detail
template <typename T> template <typename T>
struct is_mpl_sequence struct is_mpl_sequence
: mpl::and_< : mpl::and_<
mpl::not_<is_convertible<T, from_sequence_convertible_type> > mpl::not_<mpl::and_<is_complete<T>, is_convertible<T, from_sequence_convertible_type> > >
, mpl::is_sequence<T> > , mpl::is_sequence<T> >
{}; {};
}}} }}}

View File

@ -10,9 +10,11 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/sequence_base.hpp> #include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/tag_of.hpp> #include <boost/fusion/support/tag_of.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/is_sequence.hpp> #include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/or.hpp> #include <boost/mpl/or.hpp>
#include <boost/mpl/bool.hpp> #include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
@ -69,7 +71,10 @@ namespace boost { namespace fusion
template <typename Sequence, typename Enable = void> template <typename Sequence, typename Enable = void>
struct is_native_fusion_sequence struct is_native_fusion_sequence
: is_convertible<Sequence, fusion::detail::from_sequence_convertible_type> : mpl::and_<
is_complete<Sequence>,
is_convertible<Sequence, fusion::detail::from_sequence_convertible_type>
>
{}; {};
} }
}} }}

View File

@ -237,6 +237,7 @@ project
[ run sequence/ref_vector.cpp ] [ run sequence/ref_vector.cpp ]
[ run sequence/flatten_view.cpp ] [ run sequence/flatten_view.cpp ]
[ compile sequence/github-159.cpp ] [ compile sequence/github-159.cpp ]
[ run sequence/github-176.cpp ]
[ compile sequence/size.cpp ] [ compile sequence/size.cpp ]
@ -254,6 +255,7 @@ project
[ run functional/invoke_procedure.cpp ] [ run functional/invoke_procedure.cpp ]
[ run sequence/swap.cpp ] [ run sequence/swap.cpp ]
[ compile support/is_sequence.cpp ]
[ compile support/pair_deque.cpp ] [ compile support/pair_deque.cpp ]
[ compile support/pair_list.cpp ] [ compile support/pair_list.cpp ]
[ compile support/pair_map.cpp ] [ compile support/pair_map.cpp ]
@ -264,6 +266,7 @@ project
: [ requires cxx11_variadic_templates ] ] : [ requires cxx11_variadic_templates ] ]
[ compile support/and.cpp [ compile support/and.cpp
: [ requires cxx11_variadic_templates ] ] : [ requires cxx11_variadic_templates ] ]
[ compile support/tag_of.cpp ]
# [ compile-fail xxx.cpp ] # [ compile-fail xxx.cpp ]

View File

@ -5,7 +5,7 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES // $$$ JDG temp $$$ #define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#include <boost/fusion/container/deque/deque.hpp> #include <boost/fusion/container/deque/deque.hpp>
#define FUSION_SEQUENCE boost::fusion::deque<std::vector<x>> #define FUSION_SEQUENCE boost::fusion::deque<std::vector<x>>

View File

@ -0,0 +1,86 @@
/*=============================================================================
Copyright (c) 2018 Kohei Takahashi
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/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/container/list.hpp>
#include <boost/fusion/container/deque.hpp>
#include <boost/fusion/container/map.hpp>
#include <boost/fusion/container/set.hpp>
#include <boost/fusion/tuple/tuple.hpp>
#include <boost/core/lightweight_test.hpp>
template <typename Sequence>
void test_at()
{
Sequence seq;
// zero initialized
BOOST_TEST(boost::fusion::at_c<0>(seq)[0] == 0);
BOOST_TEST(boost::fusion::at_c<0>(seq)[1] == 0);
BOOST_TEST(boost::fusion::at_c<0>(seq)[2] == 0);
int (&arr)[3] = boost::fusion::deref(boost::fusion::begin(seq));
arr[0] = 2;
arr[1] = 4;
arr[2] = 6;
BOOST_TEST(boost::fusion::at_c<0>(seq)[0] == 2);
BOOST_TEST(boost::fusion::at_c<0>(seq)[1] == 4);
BOOST_TEST(boost::fusion::at_c<0>(seq)[2] == 6);
boost::fusion::at_c<0>(seq)[1] = 42;
BOOST_TEST(boost::fusion::at_c<0>(seq)[0] == 2);
BOOST_TEST(boost::fusion::at_c<0>(seq)[1] == 42);
BOOST_TEST(boost::fusion::at_c<0>(seq)[2] == 6);
}
template <typename T> inline T& value(T& v) { return v; }
template <typename K, typename T> inline T& value(boost::fusion::pair<K, T>& v) { return v.second; }
template <typename Sequence>
void test_at_key()
{
Sequence seq;
// zero initialized
BOOST_TEST(boost::fusion::at_key<int[3]>(seq)[0] == 0);
BOOST_TEST(boost::fusion::at_key<int[3]>(seq)[1] == 0);
BOOST_TEST(boost::fusion::at_key<int[3]>(seq)[2] == 0);
int (&arr)[3] = value(boost::fusion::deref(boost::fusion::begin(seq)));
arr[0] = 2;
arr[1] = 4;
arr[2] = 6;
BOOST_TEST(boost::fusion::at_key<int[3]>(seq)[0] == 2);
BOOST_TEST(boost::fusion::at_key<int[3]>(seq)[1] == 4);
BOOST_TEST(boost::fusion::at_key<int[3]>(seq)[2] == 6);
boost::fusion::at_key<int[3]>(seq)[1] = 42;
BOOST_TEST(boost::fusion::at_key<int[3]>(seq)[0] == 2);
BOOST_TEST(boost::fusion::at_key<int[3]>(seq)[1] == 42);
BOOST_TEST(boost::fusion::at_key<int[3]>(seq)[2] == 6);
}
int main()
{
using namespace boost::fusion;
test_at<vector<int[3]> >();
test_at<deque<int[3]> >();
test_at<list<int[3]> >();
test_at<tuple<int[3]> >();
test_at_key<set<int[3]> >();
test_at_key<map<pair<int[3], int[3]> > >();
}

View File

@ -5,7 +5,7 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES // $$$ JDG temp $$$ #define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#include <boost/fusion/container/map/map.hpp> #include <boost/fusion/container/map/map.hpp>
struct k1 {}; struct k1 {};

View File

@ -5,7 +5,7 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying 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) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES // $$$ JDG temp $$$ #define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#include <boost/fusion/container/vector/vector.hpp> #include <boost/fusion/container/vector/vector.hpp>
#define FUSION_SEQUENCE boost::fusion::vector<std::vector<x>> #define FUSION_SEQUENCE boost::fusion::vector<std::vector<x>>

View File

@ -11,24 +11,18 @@
# error "does not meet requirements" # error "does not meet requirements"
#endif #endif
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/support/detail/and.hpp> #include <boost/fusion/support/detail/and.hpp>
#include <boost/mpl/bool.hpp> #include <boost/mpl/bool.hpp>
#include <boost/type_traits/integral_constant.hpp> #include <boost/mpl/assert.hpp>
int main() { using namespace boost;
using namespace boost; using namespace boost::fusion::detail;
using namespace boost::fusion::detail;
BOOST_TEST((and_<>::value));
BOOST_TEST(!(and_<false_type>::value));
BOOST_TEST((and_<true_type>::value));
BOOST_TEST(!(and_<true_type, false_type>::value));
BOOST_TEST((and_<true_type, true_type>::value));
BOOST_TEST(!(and_<true_type, true_type, false_type>::value));
BOOST_TEST((and_<true_type, true_type, true_type>::value));
BOOST_TEST((and_<true_type, mpl::true_>::value));
return boost::report_errors();
}
BOOST_MPL_ASSERT((and_<>));
BOOST_MPL_ASSERT_NOT((and_<false_type>));
BOOST_MPL_ASSERT((and_<true_type>));
BOOST_MPL_ASSERT_NOT((and_<true_type, false_type>));
BOOST_MPL_ASSERT((and_<true_type, true_type>));
BOOST_MPL_ASSERT_NOT((and_<true_type, true_type, false_type>));
BOOST_MPL_ASSERT((and_<true_type, true_type, true_type>));
BOOST_MPL_ASSERT((and_<true_type, mpl::true_>));

View File

@ -0,0 +1,17 @@
/*=============================================================================
Copyright (c) 2018 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/fusion/support/is_sequence.hpp>
#include <boost/static_assert.hpp>
// Make sure fusion::is_sequence and fusion::is_native_fusion_sequence can be
// used with an incomplete type.
struct incomplete;
BOOST_STATIC_ASSERT(!boost::fusion::traits::is_sequence<incomplete>::value);
BOOST_STATIC_ASSERT(!boost::fusion::traits::is_native_fusion_sequence<incomplete>::value);
int main() { }

17
test/support/tag_of.cpp Normal file
View File

@ -0,0 +1,17 @@
/*=============================================================================
Copyright (c) 2018 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/fusion/support/tag_of.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
// Make sure tag_of can be used with an incomplete type.
struct incomplete;
typedef boost::fusion::traits::tag_of<incomplete>::type Tag;
BOOST_STATIC_ASSERT((boost::is_same<Tag, boost::fusion::non_fusion_tag>::value));
int main() { }