diff --git a/doc/fusion.qbk b/doc/fusion.qbk index 0a24cb32..6d6987d5 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -2,6 +2,7 @@ Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2006 Dan Marsden Copyright (C) 2010 Christopher Schmidt + Copyright (C) 2018 Kohei Takahashi Use, modification and distribution is subject to the Boost Software 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 __phoenix__ [@http://www.boost.org/libs/phoenix/index.html Phoenix]] -[def __mpl__ [@http://www.boost.org/libs/mpl/index.html MPL]] +[def __spirit__ [@http://boost-spirit.com/home/ Spirit]] +[def __phoenix__ [@http://www.boost.org/libs/phoenix Phoenix]] +[def __mpl__ [@http://www.boost.org/libs/mpl MPL]] [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 __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_general__ [@news://news.gmane.org/gmane.comp.spirit.general Spirit General NNTP news portal]] -[def __gmane__ [@http://www.gmane.org Gmane]] -[def __mlist_archive__ [@http://news.gmane.org/gmane.comp.parsers.spirit.general]] +[def __spirit_list__ [@https://sourceforge.net/projects/spirit/lists/spirit-general Spirit Mailing List]] +[def __list_archive__ [@https://sourceforge.net/p/spirit/mailman/spirit-general/ archive]] [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 __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 __boost_array_library__ [@http://www.boost.org/doc/html/array.html Boost.Array Library]] -[def __boost_variant_library__ [@http://www.boost.org/doc/html/variant.html Boost.Variant Library]] -[def __boost_tuple_library__ [@http://www.boost.org/libs/tuple/doc/tuple_users_guide.html Boost.Tuple Library]] -[def __boost_ref__ [@http://www.boost.org/doc/html/ref.html Boost.Ref]] -[def __boost_ref_call__ [@http://www.boost.org/doc/html/ref.html `ref`]] -[def __boost_result_of__ [@http://www.boost.org/libs/utility/utility.htm#result_of Boost.ResultOf]] +[def __boost_array_library__ [@http://www.boost.org/libs/array Boost.Array Library]] +[def __boost_variant_library__ [@http://www.boost.org/libs/variant Boost.Variant Library]] +[def __boost_tuple_library__ [@http://www.boost.org/libs/tuple Boost.Tuple Library]] +[def __boost_ref__ [@http://www.boost.org/libs/core/ref.html Ref utility]] +[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 ResultOf utility]] [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_shared_ptr_call__ [@http://www.boost.org/libs/smart_ptr/shared_ptr.htm `boost::shared_ptr`]] -[def __boost_func_forward__ [@http://www.boost.org/libs/functional/forward/doc/html/index.html Boost.Functional/Forward]] -[def __boost_func_factory__ [@http://www.boost.org/libs/functional/factory/doc/html/index.html Boost.Functional/Factory]] -[def __boost_func_hash__ [@http://www.boost.org/doc/html/hash.html Boost.Functional/Hash]] -[def __std_pair_doc__ [@http://www.sgi.com/tech/stl/pair.html `std::pair`]] +[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 `boost::shared_ptr`]] +[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 Boost.Functional/Factory Library]] +[def __boost_func_hash__ [@http://www.boost.org/doc/html/hash.html Boost.ContainerHash Library]] +[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_plus_doc__ [@http://www.sgi.com/tech/stl/plus.html `std::plus`]] -[def __std_minus_doc__ [@http://www.sgi.com/tech/stl/minus.html `std::minus`]] +[def __std_plus_doc__ [@http://en.cppreference.com/w/cpp/utility/functional/plus `std::plus`]] +[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_boolean_constant__ [@http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html MPL Boolean Constant]] diff --git a/doc/preface.qbk b/doc/preface.qbk index 2fff963a..a6ab573f 100644 --- a/doc/preface.qbk +++ b/doc/preface.qbk @@ -61,11 +61,8 @@ tool. QuickBook can be found in the __boost_tools__. [heading Support] 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 -this archive is provided in __spirit__'s home page. You may also read and post -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__. +__spirit_list__. The mailing list has a searchable archive. Here is a link to +the archives: __list_archive__. [endsect] diff --git a/doc/references.qbk b/doc/references.qbk index d0d63019..a07815d4 100644 --- a/doc/references.qbk +++ b/doc/references.qbk @@ -1,6 +1,7 @@ [/============================================================================== Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2006 Dan Marsden + Copyright (C) 2018 Kohei Takahashi Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -8,20 +9,20 @@ ===============================================================================/] [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. -# [@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. -# [@http://www.boost.org/libs/spirit/ Spirit Parser Library], +# [@http://www.boost.org/libs/spirit Spirit Parser Library], 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. -# [@http://www.boost.org/doc/html/array.html Boost Array], +# [@http://www.boost.org/libs/array The Boost Array Library], Nicolai Josuttis, 2002-2004. -# [@http://www.sgi.com/tech/stl/ Standard Template Library Programmer's Guide], - Hewlett-Packard Company, 1994. -# [@http://www.boost.org/doc/html/ref.html Boost.Ref], +# [@http://www.boost.org/libs/core/ref.html Boost.Core / Ref utility], Jaakko Jarvi, Peter Dimov, Douglas Gregor, Dave Abrahams, 1999-2002. +# [@http://www.boost.org/libs/hana The Boost Hana Library], + Louis Dionne, 2017. [endsect] diff --git a/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp index e95daf3a..860a2a29 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp @@ -26,7 +26,13 @@ namespace boost { namespace fusion { namespace detail BOOST_FUSION_BARRIER_BEGIN template - struct as_deque; + struct as_deque + { + BOOST_STATIC_ASSERT_MSG( + size <= FUSION_MAX_DEQUE_SIZE + , "FUSION_MAX_DEQUE_SIZE limit is too low" + ); + }; template <> struct as_deque<0> diff --git a/include/boost/fusion/container/map/detail/cpp03/as_map.hpp b/include/boost/fusion/container/map/detail/cpp03/as_map.hpp index efa836ba..442c350c 100644 --- a/include/boost/fusion/container/map/detail/cpp03/as_map.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/as_map.hpp @@ -25,7 +25,13 @@ namespace boost { namespace fusion { namespace detail BOOST_FUSION_BARRIER_BEGIN template - struct as_map; + struct as_map + { + BOOST_STATIC_ASSERT_MSG( + size <= FUSION_MAX_MAP_SIZE + , "FUSION_MAX_MAP_SIZE limit is too low" + ); + }; template struct as_map<0, is_assoc> diff --git a/include/boost/fusion/container/map/detail/map_impl.hpp b/include/boost/fusion/container/map/detail/map_impl.hpp index c62145ba..360c5d09 100644 --- a/include/boost/fusion/container/map/detail/map_impl.hpp +++ b/include/boost/fusion/container/map/detail/map_impl.hpp @@ -125,11 +125,7 @@ namespace boost { namespace fusion { namespace detail } BOOST_FUSION_GPU_ENABLED - value_type get_val(mpl::identity); - BOOST_FUSION_GPU_ENABLED - pair_type get_val(mpl::int_); - BOOST_FUSION_GPU_ENABLED - value_type get_val(mpl::identity) const; + mpl::identity get_val(mpl::identity) const; BOOST_FUSION_GPU_ENABLED pair_type get_val(mpl::int_) const; diff --git a/include/boost/fusion/container/map/detail/value_at_key_impl.hpp b/include/boost/fusion/container/map/detail/value_at_key_impl.hpp index 94d2da47..da6259e6 100644 --- a/include/boost/fusion/container/map/detail/value_at_key_impl.hpp +++ b/include/boost/fusion/container/map/detail/value_at_key_impl.hpp @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2001-2013 Joel de Guzman + 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) @@ -8,10 +9,6 @@ #define BOOST_FUSION_MAP_DETAIL_VALUE_AT_KEY_IMPL_02042013_0821 #include -#include -#include -#include -#include #include namespace boost { namespace fusion @@ -29,9 +26,9 @@ namespace boost { namespace fusion template struct apply { - typedef - decltype(boost::declval().get_val(mpl::identity())) - type; + typedef typename BOOST_FUSION_IDENTIFIED_TYPE(( + boost::declval().get_val(mpl::identity()) + )) type; }; }; } diff --git a/include/boost/fusion/container/set/detail/cpp03/as_set.hpp b/include/boost/fusion/container/set/detail/cpp03/as_set.hpp index c9159314..ec73a158 100644 --- a/include/boost/fusion/container/set/detail/cpp03/as_set.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/as_set.hpp @@ -25,7 +25,13 @@ namespace boost { namespace fusion { namespace detail BOOST_FUSION_BARRIER_BEGIN template - struct as_set; + struct as_set + { + BOOST_STATIC_ASSERT_MSG( + size <= FUSION_MAX_SET_SIZE + , "FUSION_MAX_SET_SIZE limit is too low" + ); + }; template <> struct as_set<0> diff --git a/include/boost/fusion/container/vector/detail/cpp03/as_vector.hpp b/include/boost/fusion/container/vector/detail/cpp03/as_vector.hpp index bd7fa76b..471f7840 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/as_vector.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/as_vector.hpp @@ -25,7 +25,13 @@ namespace boost { namespace fusion { namespace detail BOOST_FUSION_BARRIER_BEGIN template - struct as_vector; + struct as_vector + { + BOOST_STATIC_ASSERT_MSG( + size <= FUSION_MAX_VECTOR_SIZE + , "FUSION_MAX_VECTOR_SIZE limit is too low" + ); + }; template <> struct as_vector<0> diff --git a/include/boost/fusion/container/vector/detail/value_at_impl.hpp b/include/boost/fusion/container/vector/detail/value_at_impl.hpp index a2b9b2f6..a2dd5fcd 100644 --- a/include/boost/fusion/container/vector/detail/value_at_impl.hpp +++ b/include/boost/fusion/container/vector/detail/value_at_impl.hpp @@ -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 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 #define FUSION_VALUE_AT_IMPL_16122014_1641 -#include #include #include @@ -23,6 +22,7 @@ /////////////////////////////////////////////////////////////////////////////// #include #include +#include namespace boost { namespace fusion { @@ -35,7 +35,7 @@ namespace boost { namespace fusion template static inline BOOST_FUSION_GPU_ENABLED - U value_at_impl(store const volatile*); + mpl::identity value_at_impl(store const volatile*); } namespace extension @@ -49,9 +49,9 @@ namespace boost { namespace fusion template struct apply { - typedef - decltype(vector_detail::value_at_impl(boost::declval())) - type; + typedef typename BOOST_FUSION_IDENTIFIED_TYPE(( + vector_detail::value_at_impl(boost::declval()) + )) type; }; }; } diff --git a/include/boost/fusion/support/config.hpp b/include/boost/fusion/support/config.hpp index 23554531..65fe2f35 100644 --- a/include/boost/fusion/support/config.hpp +++ b/include/boost/fusion/support/config.hpp @@ -1,6 +1,6 @@ /*============================================================================= 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 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 #endif + +// Workaround for compiler which doesn't compile decltype(expr)::type. +// It expects decltype(expr) deduced as mpl::identity. +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1913)) +# include +# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \ + boost::mpl::identity::type::type +#else +# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \ + decltype parenthesized_expr ::type +#endif + #endif diff --git a/include/boost/fusion/support/detail/is_mpl_sequence.hpp b/include/boost/fusion/support/detail/is_mpl_sequence.hpp index 1c485f91..24b86624 100644 --- a/include/boost/fusion/support/detail/is_mpl_sequence.hpp +++ b/include/boost/fusion/support/detail/is_mpl_sequence.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include namespace boost { namespace fusion { namespace detail @@ -20,7 +21,7 @@ namespace boost { namespace fusion { namespace detail template struct is_mpl_sequence : mpl::and_< - mpl::not_ > + mpl::not_, is_convertible > > , mpl::is_sequence > {}; }}} diff --git a/include/boost/fusion/support/is_sequence.hpp b/include/boost/fusion/support/is_sequence.hpp index 6b9b2118..af7c84e1 100644 --- a/include/boost/fusion/support/is_sequence.hpp +++ b/include/boost/fusion/support/is_sequence.hpp @@ -10,9 +10,11 @@ #include #include #include +#include +#include #include #include -#include +#include #include #include @@ -69,7 +71,10 @@ namespace boost { namespace fusion template struct is_native_fusion_sequence - : is_convertible + : mpl::and_< + is_complete, + is_convertible + > {}; } }} diff --git a/test/Jamfile b/test/Jamfile index 82d715bb..9492e83f 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -237,6 +237,7 @@ project [ run sequence/ref_vector.cpp ] [ run sequence/flatten_view.cpp ] [ compile sequence/github-159.cpp ] + [ run sequence/github-176.cpp ] [ compile sequence/size.cpp ] @@ -254,6 +255,7 @@ project [ run functional/invoke_procedure.cpp ] [ run sequence/swap.cpp ] + [ compile support/is_sequence.cpp ] [ compile support/pair_deque.cpp ] [ compile support/pair_list.cpp ] [ compile support/pair_map.cpp ] @@ -264,6 +266,7 @@ project : [ requires cxx11_variadic_templates ] ] [ compile support/and.cpp : [ requires cxx11_variadic_templates ] ] + [ compile support/tag_of.cpp ] # [ compile-fail xxx.cpp ] diff --git a/test/sequence/deque_move.cpp b/test/sequence/deque_move.cpp index b3675b24..b3bdf11b 100644 --- a/test/sequence/deque_move.cpp +++ b/test/sequence/deque_move.cpp @@ -5,7 +5,7 @@ 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) ==============================================================================*/ -#define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES // $$$ JDG temp $$$ +#define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES #include #define FUSION_SEQUENCE boost::fusion::deque> diff --git a/test/sequence/github-176.cpp b/test/sequence/github-176.cpp new file mode 100644 index 00000000..82960e9a --- /dev/null +++ b/test/sequence/github-176.cpp @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include + +template +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 inline T& value(T& v) { return v; } +template inline T& value(boost::fusion::pair& v) { return v.second; } + +template +void test_at_key() +{ + Sequence seq; + + // zero initialized + BOOST_TEST(boost::fusion::at_key(seq)[0] == 0); + BOOST_TEST(boost::fusion::at_key(seq)[1] == 0); + BOOST_TEST(boost::fusion::at_key(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(seq)[0] == 2); + BOOST_TEST(boost::fusion::at_key(seq)[1] == 4); + BOOST_TEST(boost::fusion::at_key(seq)[2] == 6); + + boost::fusion::at_key(seq)[1] = 42; + + BOOST_TEST(boost::fusion::at_key(seq)[0] == 2); + BOOST_TEST(boost::fusion::at_key(seq)[1] == 42); + BOOST_TEST(boost::fusion::at_key(seq)[2] == 6); +} + +int main() +{ + using namespace boost::fusion; + + test_at >(); + test_at >(); + test_at >(); + test_at >(); + + test_at_key >(); + test_at_key > >(); +} diff --git a/test/sequence/map_move.cpp b/test/sequence/map_move.cpp index fcac58aa..9f9dd004 100644 --- a/test/sequence/map_move.cpp +++ b/test/sequence/map_move.cpp @@ -5,7 +5,7 @@ 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) ==============================================================================*/ -#define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES // $$$ JDG temp $$$ +#define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES #include struct k1 {}; diff --git a/test/sequence/vector_move.cpp b/test/sequence/vector_move.cpp index 4e5ae7c8..3e9f0b6a 100644 --- a/test/sequence/vector_move.cpp +++ b/test/sequence/vector_move.cpp @@ -5,7 +5,7 @@ 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) ==============================================================================*/ -#define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES // $$$ JDG temp $$$ +#define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES #include #define FUSION_SEQUENCE boost::fusion::vector> diff --git a/test/support/and.cpp b/test/support/and.cpp index b657ead5..604a68d7 100644 --- a/test/support/and.cpp +++ b/test/support/and.cpp @@ -11,24 +11,18 @@ # error "does not meet requirements" #endif -#include #include #include -#include +#include -int main() { - using namespace boost; - using namespace boost::fusion::detail; - - BOOST_TEST((and_<>::value)); - BOOST_TEST(!(and_::value)); - BOOST_TEST((and_::value)); - BOOST_TEST(!(and_::value)); - BOOST_TEST((and_::value)); - BOOST_TEST(!(and_::value)); - BOOST_TEST((and_::value)); - BOOST_TEST((and_::value)); - - return boost::report_errors(); -} +using namespace boost; +using namespace boost::fusion::detail; +BOOST_MPL_ASSERT((and_<>)); +BOOST_MPL_ASSERT_NOT((and_)); +BOOST_MPL_ASSERT((and_)); +BOOST_MPL_ASSERT_NOT((and_)); +BOOST_MPL_ASSERT((and_)); +BOOST_MPL_ASSERT_NOT((and_)); +BOOST_MPL_ASSERT((and_)); +BOOST_MPL_ASSERT((and_)); diff --git a/test/support/is_sequence.cpp b/test/support/is_sequence.cpp new file mode 100644 index 00000000..428f6354 --- /dev/null +++ b/test/support/is_sequence.cpp @@ -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 +#include + + +// 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::value); +BOOST_STATIC_ASSERT(!boost::fusion::traits::is_native_fusion_sequence::value); + +int main() { } diff --git a/test/support/tag_of.cpp b/test/support/tag_of.cpp new file mode 100644 index 00000000..ee2da10d --- /dev/null +++ b/test/support/tag_of.cpp @@ -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 +#include +#include + + +// Make sure tag_of can be used with an incomplete type. +struct incomplete; +typedef boost::fusion::traits::tag_of::type Tag; +BOOST_STATIC_ASSERT((boost::is_same::value)); + +int main() { }