diff --git a/include/boost/fusion/adapted/adt/adapt_adt.hpp b/include/boost/fusion/adapted/adt/adapt_adt.hpp index 2ebc76c3..3f99fb2e 100644 --- a/include/boost/fusion/adapted/adt/adapt_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_adt.hpp @@ -16,10 +16,6 @@ #include #include #include -#include -#include -#include -#include #include #include diff --git a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp index bd451a32..dde9e75e 100644 --- a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp @@ -15,9 +15,6 @@ #include #include #include -#include -#include -#include #include #include diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 0ef6fcd9..6bceb757 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -21,8 +21,8 @@ #include #include #include -#include #include +#include #include @@ -83,20 +83,8 @@ typedef \ BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \ typename) \ - boost::remove_const< \ - BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \ - typename) \ - deduced_attr_type::type \ - >::type type; \ - \ - typedef \ - BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \ - typename) \ - boost::add_const< \ - BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \ - typename) \ - deduced_attr_type::type \ - >::type const_type; + deduced_attr_type::type type; \ + typedef type const_type; #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index c8659fdf..b5632210 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -15,10 +15,6 @@ #include #include #include -#include -#include -#include -#include #include #include diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 66710b47..928bc995 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -18,10 +18,6 @@ #include #include #include -#include -#include -#include -#include #include #include diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 84b9302c..c66118f4 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -34,7 +34,9 @@ #include #include #include +#include #include +#include #include diff --git a/include/boost/fusion/algorithm/query/detail/find_if.hpp b/include/boost/fusion/algorithm/query/detail/find_if.hpp index b200794a..06a7af79 100644 --- a/include/boost/fusion/algorithm/query/detail/find_if.hpp +++ b/include/boost/fusion/algorithm/query/detail/find_if.hpp @@ -2,6 +2,7 @@ Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2007 Dan Marsden Copyright (c) 2009 Christopher Schmidt + 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) @@ -13,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -22,10 +22,9 @@ #include #include #include +#include -namespace boost { namespace fusion { - struct random_access_traversal_tag; -namespace detail +namespace boost { namespace fusion { namespace detail { template struct apply_filter @@ -178,8 +177,8 @@ namespace detail choose_find_if< First , Last - , typename mpl::lambda::type - , is_base_of::type>::value + , Pred + , traits::is_random_access::value >::type type; @@ -208,31 +207,23 @@ namespace detail return recursive_call(iter, found()); } - template + template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - static type - choose_call(Iterator const& iter, Tag) + static typename boost::disable_if, type>::type + iter_call(Iterator const& iter) { return recursive_call(iter); } template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - static type - choose_call(Iterator const& iter, random_access_traversal_tag) + static typename boost::enable_if, type>::type + iter_call(Iterator const& iter) { typedef typename result_of::distance::type N; return fusion::advance(iter); } - template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - static type - iter_call(Iterator const& iter) - { - return choose_call(iter, typename traits::category_of::type()); - } - template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type diff --git a/include/boost/fusion/algorithm/transformation/remove_if.hpp b/include/boost/fusion/algorithm/transformation/remove_if.hpp index 5497e3a3..3f8ebbcd 100644 --- a/include/boost/fusion/algorithm/transformation/remove_if.hpp +++ b/include/boost/fusion/algorithm/transformation/remove_if.hpp @@ -1,7 +1,8 @@ /*============================================================================= Copyright (c) 2001-2011 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) ==============================================================================*/ #if !defined(FUSION_REMOVE_IF_07162005_0818) @@ -10,7 +11,6 @@ #include #include #include -#include namespace boost { namespace fusion { 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 da6259e6..d53a8f02 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 @@ -24,12 +24,10 @@ namespace boost { namespace fusion struct value_at_key_impl { template - struct apply - { - typedef typename BOOST_FUSION_IDENTIFIED_TYPE(( + struct apply : BOOST_FUSION_DECLTYPE_N3031(( boost::declval().get_val(mpl::identity()) - )) type; - }; + )) + {}; }; } }} diff --git a/include/boost/fusion/container/map/map_fwd.hpp b/include/boost/fusion/container/map/map_fwd.hpp index 18e445b0..614ea249 100644 --- a/include/boost/fusion/container/map/map_fwd.hpp +++ b/include/boost/fusion/container/map/map_fwd.hpp @@ -36,8 +36,6 @@ # include #else -#include - /////////////////////////////////////////////////////////////////////////////// // C++11 interface /////////////////////////////////////////////////////////////////////////////// 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 a2dd5fcd..f29c0e14 100644 --- a/include/boost/fusion/container/vector/detail/value_at_impl.hpp +++ b/include/boost/fusion/container/vector/detail/value_at_impl.hpp @@ -47,12 +47,10 @@ namespace boost { namespace fusion struct value_at_impl { template - struct apply - { - typedef typename BOOST_FUSION_IDENTIFIED_TYPE(( + struct apply : BOOST_FUSION_DECLTYPE_N3031(( vector_detail::value_at_impl(boost::declval()) - )) type; - }; + )) + {}; }; } }} diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 4993e2eb..02ffe514 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -168,9 +168,15 @@ namespace boost { namespace fusion : elem(std::forward(rhs)) {} + using elem_type = T; T elem; }; + // placed outside of vector_data due to GCC < 6 bug + template + static inline BOOST_FUSION_GPU_ENABLED + store store_at_impl(store*); + template struct vector_data; @@ -231,32 +237,23 @@ namespace boost { namespace fusion assign(std::forward(seq), detail::index_sequence()); } - template - static BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED - U& at_detail(store* this_) - { - return this_->elem; - } - - template - static BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - U const& at_detail(store const* this_) - { - return this_->elem; - } + private: + template + using store_at = decltype(store_at_impl(static_cast(nullptr))); + public: template BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED - auto at_impl(J) -> decltype(at_detail(&std::declval())) + typename store_at::elem_type& at_impl(J) { - return at_detail(this); + return store_at::elem; } template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - auto at_impl(J) const -> decltype(at_detail(&std::declval())) + typename store_at::elem_type const& at_impl(J) const { - return at_detail(this); + return store_at::elem; } }; } // namespace boost::fusion::vector_detail diff --git a/include/boost/fusion/support/config.hpp b/include/boost/fusion/support/config.hpp index d27266ed..dc614d9d 100644 --- a/include/boost/fusion/support/config.hpp +++ b/include/boost/fusion/support/config.hpp @@ -97,15 +97,26 @@ namespace std #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)) || BOOST_WORKAROUND(BOOST_GCC, < 40700) +// Workaround for compilers not implementing N3031 (DR743 and DR950). +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1913)) || \ + BOOST_WORKAROUND(BOOST_GCC, < 40700) || \ + defined(BOOST_CLANG) && (__clang_major__ == 3 && __clang_minor__ == 0) +# if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) +namespace boost { namespace fusion { namespace detail +{ + template + using type_alias_t = T; +}}} +# define BOOST_FUSION_DECLTYPE_N3031(parenthesized_expr) \ + boost::fusion::detail::type_alias_t +# else # include -# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \ - boost::mpl::identity::type::type +# define BOOST_FUSION_DECLTYPE_N3031(parenthesized_expr) \ + boost::mpl::identity::type +# endif #else -# define BOOST_FUSION_IDENTIFIED_TYPE(parenthesized_expr) \ - decltype parenthesized_expr ::type +# define BOOST_FUSION_DECLTYPE_N3031(parenthesized_expr) \ + decltype parenthesized_expr #endif diff --git a/include/boost/fusion/support/detail/is_same_size.hpp b/include/boost/fusion/support/detail/is_same_size.hpp index b1bf7cde..02d29534 100644 --- a/include/boost/fusion/support/detail/is_same_size.hpp +++ b/include/boost/fusion/support/detail/is_same_size.hpp @@ -9,20 +9,19 @@ #include #include -#include #include -#include namespace boost { namespace fusion { namespace detail { - template + template ::value && + traits::is_sequence::value> struct is_same_size : mpl::false_ {}; template - struct is_same_size >::type, - typename enable_if >::type> - : mpl::equal_to, result_of::size > + struct is_same_size + : mpl::bool_::value == + result_of::size::value> {}; }}} diff --git a/include/boost/fusion/support/is_view.hpp b/include/boost/fusion/support/is_view.hpp index a6ca7259..b2b52c42 100644 --- a/include/boost/fusion/support/is_view.hpp +++ b/include/boost/fusion/support/is_view.hpp @@ -14,6 +14,7 @@ namespace boost { namespace fusion { // Special tags: + struct non_fusion_tag; struct sequence_facade_tag; struct boost_tuple_tag; // boost::tuples::tuple tag struct boost_array_tag; // boost::array tag @@ -32,6 +33,13 @@ namespace boost { namespace fusion }; }; + template <> + struct is_view_impl + { + template + struct apply : mpl::false_ {}; + }; + template <> struct is_view_impl { diff --git a/include/boost/fusion/view/filter_view/detail/next_impl.hpp b/include/boost/fusion/view/filter_view/detail/next_impl.hpp index 4f174557..bd1404b9 100644 --- a/include/boost/fusion/view/filter_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/next_impl.hpp @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2001-2011 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,14 +9,10 @@ #define FUSION_NEXT_IMPL_06052005_0900 #include -#include -#include +#include +#include #include #include -#include -#include -#include -#include namespace boost { namespace fusion { @@ -48,26 +45,13 @@ namespace boost { namespace fusion >::type next_type; - typedef typename - detail::static_find_if< - next_type - , last_type - , mpl::bind1< - typename mpl::lambda::type - , mpl::bind1,mpl::_1> - > - > - filter; - - typedef filter_iterator< - category, typename filter::type, last_type, pred_type> - type; + typedef filter_iterator type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { - return type(filter::iter_call(i.first)); + return type(fusion::next(i.first)); } }; }; diff --git a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp index f1b9f54d..8d77e12e 100644 --- a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp +++ b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2001-2011 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) @@ -9,7 +10,6 @@ #include #include -#include #include #include #include diff --git a/test/Jamfile b/test/Jamfile index c880b984..e55b15ad 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -257,6 +257,7 @@ project [ run sequence/swap.cpp ] [ compile support/is_sequence.cpp ] + [ compile support/is_view.cpp ] [ compile support/pair_deque.cpp ] [ compile support/pair_list.cpp ] [ compile support/pair_map.cpp ] diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index 98958348..00a149b7 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -165,6 +165,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); ns::point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; @@ -237,6 +238,7 @@ main() #if !BOOST_WORKAROUND(__GNUC__,<4) { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); ns::point_with_private_members p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; @@ -300,7 +302,7 @@ main() BOOST_MPL_ASSERT(( boost::is_same< boost::fusion::result_of::back::type::type, - const int + int >)); } diff --git a/test/sequence/adapt_adt_empty.cpp b/test/sequence/adapt_adt_empty.cpp index 925cdce0..03e786b7 100644 --- a/test/sequence/adapt_adt_empty.cpp +++ b/test/sequence/adapt_adt_empty.cpp @@ -42,6 +42,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); empty_adt e; std::cout << e << std::endl; diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index 6ed9e1d2..19d2d8b1 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -93,6 +93,7 @@ main() { BOOST_MPL_ASSERT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_view::value); ns::point basep(123, 456, 789); adapted::point p(basep); diff --git a/test/sequence/adapt_adt_named_empty.cpp b/test/sequence/adapt_adt_named_empty.cpp index f750071d..c7fa2033 100644 --- a/test/sequence/adapt_adt_named_empty.cpp +++ b/test/sequence/adapt_adt_named_empty.cpp @@ -43,6 +43,7 @@ main() empty_adt empty; { BOOST_MPL_ASSERT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_view::value); adapted::empty_adt e(empty); std::cout << e << std::endl; diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index 02c7afa2..a0dc2232 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -84,6 +84,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); ns::point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/adapt_assoc_adt_empty.cpp b/test/sequence/adapt_assoc_adt_empty.cpp index 8d4d2a28..26cd9857 100644 --- a/test/sequence/adapt_assoc_adt_empty.cpp +++ b/test/sequence/adapt_assoc_adt_empty.cpp @@ -42,6 +42,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); empty_adt e; std::cout << e << std::endl; diff --git a/test/sequence/adapt_assoc_adt_named.cpp b/test/sequence/adapt_assoc_adt_named.cpp index 0fcdbb99..ecdd9028 100644 --- a/test/sequence/adapt_assoc_adt_named.cpp +++ b/test/sequence/adapt_assoc_adt_named.cpp @@ -80,6 +80,7 @@ main() { BOOST_MPL_ASSERT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_view::value); ns::point basep(123, 456); adapted::point p(basep); diff --git a/test/sequence/adapt_assoc_adt_named_empty.cpp b/test/sequence/adapt_assoc_adt_named_empty.cpp index c8fa102a..e2e26800 100644 --- a/test/sequence/adapt_assoc_adt_named_empty.cpp +++ b/test/sequence/adapt_assoc_adt_named_empty.cpp @@ -43,6 +43,7 @@ main() empty_adt empty; { BOOST_MPL_ASSERT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_view::value); adapted::empty_adt e(empty); std::cout << e << std::endl; diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index 07cab357..6266e95f 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -72,7 +72,7 @@ namespace ns #endif struct empty_struct {}; -BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,); +BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,) int main() @@ -86,6 +86,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); ns::point p = {123, 456, 789}; std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/adapt_assoc_struct_empty.cpp b/test/sequence/adapt_assoc_struct_empty.cpp index aa75f87a..c7cadf94 100644 --- a/test/sequence/adapt_assoc_struct_empty.cpp +++ b/test/sequence/adapt_assoc_struct_empty.cpp @@ -42,6 +42,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); empty_struct e; std::cout << e << std::endl; diff --git a/test/sequence/adapt_assoc_struct_named.cpp b/test/sequence/adapt_assoc_struct_named.cpp index 4fbfe8ca..96606787 100644 --- a/test/sequence/adapt_assoc_struct_named.cpp +++ b/test/sequence/adapt_assoc_struct_named.cpp @@ -53,7 +53,7 @@ namespace ns #endif struct empty_struct {}; -BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(empty_struct, renamed_empty_struct,); +BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(empty_struct, renamed_empty_struct,) int main() @@ -66,6 +66,7 @@ main() { BOOST_MPL_ASSERT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_view::value); ns::point basep = {123, 456}; adapted::point p(basep); diff --git a/test/sequence/adapt_assoc_struct_named_empty.cpp b/test/sequence/adapt_assoc_struct_named_empty.cpp index a744d6a4..a1783fd3 100644 --- a/test/sequence/adapt_assoc_struct_named_empty.cpp +++ b/test/sequence/adapt_assoc_struct_named_empty.cpp @@ -43,6 +43,7 @@ main() empty_struct empty; { BOOST_MPL_ASSERT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_view::value); adapted::empty_struct e(empty); std::cout << e << std::endl; diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index 63a358d6..f416f46a 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -98,6 +98,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index cd275024..49f42c5d 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -96,6 +96,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); point p = {123, 456, 789.43f}; std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index c0f07d0d..3518ff41 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -170,6 +170,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); point p = {123, 456, 789}; std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/adapt_struct_empty.cpp b/test/sequence/adapt_struct_empty.cpp index f08dc98d..202131d4 100644 --- a/test/sequence/adapt_struct_empty.cpp +++ b/test/sequence/adapt_struct_empty.cpp @@ -42,6 +42,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); empty_struct e; std::cout << e << std::endl; diff --git a/test/sequence/adapt_struct_named.cpp b/test/sequence/adapt_struct_named.cpp index 9f4c7bc2..ec5cf7ba 100644 --- a/test/sequence/adapt_struct_named.cpp +++ b/test/sequence/adapt_struct_named.cpp @@ -87,6 +87,7 @@ main() { BOOST_MPL_ASSERT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_view::value); ns::point basep = {123, 456, 789}; adapted::point p(basep); diff --git a/test/sequence/adapt_struct_named_empty.cpp b/test/sequence/adapt_struct_named_empty.cpp index 8333f130..7272f6f6 100644 --- a/test/sequence/adapt_struct_named_empty.cpp +++ b/test/sequence/adapt_struct_named_empty.cpp @@ -43,6 +43,7 @@ main() empty_struct empty; { BOOST_MPL_ASSERT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_view::value); adapted::empty_struct e(empty); std::cout << e << std::endl; diff --git a/test/sequence/adapt_tpl_adt.cpp b/test/sequence/adapt_tpl_adt.cpp index 3cb5e8aa..d917134a 100644 --- a/test/sequence/adapt_tpl_adt.cpp +++ b/test/sequence/adapt_tpl_adt.cpp @@ -107,6 +107,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index a5514681..1776cd62 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -96,6 +96,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); point p = {123, 456, 789}; std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/array.cpp b/test/sequence/array.cpp index 15b4ed89..ca4a40ac 100644 --- a/test/sequence/array.cpp +++ b/test/sequence/array.cpp @@ -22,6 +22,8 @@ int main() BOOST_MPL_ASSERT((traits::is_sequence)); BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_sequence::value); + BOOST_STATIC_ASSERT(!traits::is_view::value); array_type arr = {1,2,3}; diff --git a/test/sequence/boost_array.cpp b/test/sequence/boost_array.cpp index a1bb6542..f3f71470 100644 --- a/test/sequence/boost_array.cpp +++ b/test/sequence/boost_array.cpp @@ -26,6 +26,8 @@ int main() BOOST_MPL_ASSERT((traits::is_sequence)); BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_sequence::value); + BOOST_STATIC_ASSERT(!traits::is_view::value); array_type arr = {{1,2,3}}; diff --git a/test/sequence/boost_tuple.cpp b/test/sequence/boost_tuple.cpp index 7d19ffef..abe7d3c8 100644 --- a/test/sequence/boost_tuple.cpp +++ b/test/sequence/boost_tuple.cpp @@ -46,6 +46,7 @@ main() { typedef boost::tuple tuple_type; BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); tuple_type t(123, "Hola!!!"); std::cout << at_c<0>(t) << std::endl; diff --git a/test/sequence/construction.hpp b/test/sequence/construction.hpp index 57ba5301..94c7d182 100644 --- a/test/sequence/construction.hpp +++ b/test/sequence/construction.hpp @@ -54,11 +54,14 @@ test() using namespace test_detail; nil empty; + (void)empty; FUSION_SEQUENCE<> empty0; + (void)empty0; #ifndef NO_CONSTRUCT_FROM_NIL FUSION_SEQUENCE<> empty1(empty); + (void)empty1; #endif FUSION_SEQUENCE t1; diff --git a/test/sequence/define_assoc_struct.cpp b/test/sequence/define_assoc_struct.cpp index 90608c40..231621f8 100644 --- a/test/sequence/define_assoc_struct.cpp +++ b/test/sequence/define_assoc_struct.cpp @@ -42,6 +42,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); ns::point p(123, 456); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/define_assoc_struct_empty.cpp b/test/sequence/define_assoc_struct_empty.cpp index 204eda8e..91dd2f35 100644 --- a/test/sequence/define_assoc_struct_empty.cpp +++ b/test/sequence/define_assoc_struct_empty.cpp @@ -30,6 +30,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); empty_struct e; std::cout << e << std::endl; diff --git a/test/sequence/define_assoc_tpl_struct.cpp b/test/sequence/define_assoc_tpl_struct.cpp index 00b3b1ce..bdbcfe47 100644 --- a/test/sequence/define_assoc_tpl_struct.cpp +++ b/test/sequence/define_assoc_tpl_struct.cpp @@ -46,6 +46,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); point p(123, 456); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/define_assoc_tpl_struct_empty.cpp b/test/sequence/define_assoc_tpl_struct_empty.cpp index fc4ebd7f..70d6ca50 100644 --- a/test/sequence/define_assoc_tpl_struct_empty.cpp +++ b/test/sequence/define_assoc_tpl_struct_empty.cpp @@ -30,6 +30,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view >)); + BOOST_STATIC_ASSERT(!traits::is_view >::value); empty_struct e; std::cout << e << std::endl; diff --git a/test/sequence/define_struct.cpp b/test/sequence/define_struct.cpp index 51a40564..1243b9fe 100644 --- a/test/sequence/define_struct.cpp +++ b/test/sequence/define_struct.cpp @@ -54,6 +54,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); ns::point p(123, 456); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/define_struct_empty.cpp b/test/sequence/define_struct_empty.cpp index 893ed436..1468b917 100644 --- a/test/sequence/define_struct_empty.cpp +++ b/test/sequence/define_struct_empty.cpp @@ -30,6 +30,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); empty_struct e; std::cout << e << std::endl; diff --git a/test/sequence/define_struct_inline.cpp b/test/sequence/define_struct_inline.cpp index 3a902372..4a3793b7 100644 --- a/test/sequence/define_struct_inline.cpp +++ b/test/sequence/define_struct_inline.cpp @@ -66,6 +66,7 @@ void run_test() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); Point p(123, 456); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/define_struct_inline_empty.cpp b/test/sequence/define_struct_inline_empty.cpp index 4524da1b..4168770a 100644 --- a/test/sequence/define_struct_inline_empty.cpp +++ b/test/sequence/define_struct_inline_empty.cpp @@ -30,6 +30,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); empty_struct e; std::cout << e << std::endl; diff --git a/test/sequence/define_tpl_struct.cpp b/test/sequence/define_tpl_struct.cpp index bb5bf96e..b47ac611 100644 --- a/test/sequence/define_tpl_struct.cpp +++ b/test/sequence/define_tpl_struct.cpp @@ -42,6 +42,7 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); point p(123, 456); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/define_tpl_struct_inline.cpp b/test/sequence/define_tpl_struct_inline.cpp index 18fdb0d1..3a7c69e3 100644 --- a/test/sequence/define_tpl_struct_inline.cpp +++ b/test/sequence/define_tpl_struct_inline.cpp @@ -61,6 +61,7 @@ void run_test() { BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); Point p(123, 456); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/map_construction.cpp b/test/sequence/map_construction.cpp index ee308a13..9c03b426 100644 --- a/test/sequence/map_construction.cpp +++ b/test/sequence/map_construction.cpp @@ -55,11 +55,14 @@ test() using namespace test_detail; nil empty; + (void)empty; map<> empty0; + (void)empty0; #ifndef NO_CONSTRUCT_FROM_NIL map<> empty1(empty); + (void)empty1; #endif map > t1; diff --git a/test/sequence/set.cpp b/test/sequence/set.cpp index cf97c100..714c36cd 100644 --- a/test/sequence/set.cpp +++ b/test/sequence/set.cpp @@ -89,6 +89,9 @@ main() BOOST_MPL_ASSERT((traits::is_sequence)); BOOST_MPL_ASSERT((traits::is_sequence)); BOOST_MPL_ASSERT((traits::is_sequence)); + BOOST_STATIC_ASSERT(traits::is_sequence::value); + BOOST_STATIC_ASSERT(traits::is_sequence::value); + BOOST_STATIC_ASSERT(traits::is_sequence::value); } { // testing mpl::is_sequence diff --git a/test/sequence/std_array.cpp b/test/sequence/std_array.cpp index 902cbeca..50e09b39 100644 --- a/test/sequence/std_array.cpp +++ b/test/sequence/std_array.cpp @@ -33,6 +33,8 @@ int main() BOOST_MPL_ASSERT((traits::is_sequence)); BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(traits::is_sequence::value); + BOOST_STATIC_ASSERT(!traits::is_view::value); array_type arr = {{1,2,3}}; diff --git a/test/sequence/std_pair.cpp b/test/sequence/std_pair.cpp index 19f8e2a3..647e9b00 100644 --- a/test/sequence/std_pair.cpp +++ b/test/sequence/std_pair.cpp @@ -44,6 +44,7 @@ main() { typedef std::pair pair_type; BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); pair_type p(123, "Hola!!!"); std::cout << at_c<0>(p) << std::endl; diff --git a/test/sequence/vector_n.cpp b/test/sequence/vector_n.cpp index 2109bd5c..65e1032d 100644 --- a/test/sequence/vector_n.cpp +++ b/test/sequence/vector_n.cpp @@ -94,7 +94,7 @@ main() } { - vector2 t1(123, 456); + vector2 t1(123, 456); vector2 t2(t1); (void)t2; } diff --git a/test/support/is_view.cpp b/test/support/is_view.cpp new file mode 100644 index 00000000..068f1a80 --- /dev/null +++ b/test/support/is_view.cpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2018 Nikita Kniazev + + 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_view can be used with non fusion types. +struct incomplete; +BOOST_STATIC_ASSERT(!boost::fusion::traits::is_view::value); + +int main() { } diff --git a/test/support/unused.cpp b/test/support/unused.cpp index e609617f..8b9e6260 100644 --- a/test/support/unused.cpp +++ b/test/support/unused.cpp @@ -91,5 +91,6 @@ void only_unused() BOOST_STATIC_ASSERT((sizeof(test_unused(0)) == sizeof(boost::type_traits::no_type))); boost::fusion::unused_type my_unused; + (void)my_unused; BOOST_STATIC_ASSERT((sizeof(test_unused(my_unused)) == sizeof(boost::type_traits::yes_type))); }