From 12792a6c11fe8a1c6488dd455d24d20f308275ba Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 1 Dec 2015 01:14:52 +0900 Subject: [PATCH 01/18] Fix compile error with ambiguous ctor, close #11766. When a) first elem is sequence b) second (and third) elem is(are) void*, both of conversion ctor and forwarding ctor are candidate since SFINAE expression has void* type. --- include/boost/fusion/container/deque/deque.hpp | 7 ++++--- .../fusion/container/deque/detail/cpp03/deque.hpp | 11 ++++++----- include/boost/fusion/container/list/cons.hpp | 5 +++-- .../boost/fusion/container/list/detail/cpp03/list.hpp | 3 ++- include/boost/fusion/container/map/map.hpp | 7 ++++--- .../boost/fusion/container/set/detail/cpp03/set.hpp | 4 ++-- include/boost/fusion/container/set/set.hpp | 9 +++++---- .../fusion/container/vector/detail/cpp03/vector.hpp | 3 ++- include/boost/fusion/container/vector/vector.hpp | 3 ++- 9 files changed, 30 insertions(+), 22 deletions(-) diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index dee51bef..3bf0cd38 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -21,6 +21,7 @@ // C++11 interface /////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -59,7 +60,7 @@ namespace boost { namespace fusion typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty>>::type* /*dummy*/ = 0) BOOST_NOEXCEPT + , result_of::empty>, void_>::type = void_()) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED @@ -149,8 +150,8 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(Sequence const& seq - , typename disable_if >::type* /*dummy*/ = 0 - , typename enable_if >::type* /*dummy*/ = 0) + , typename disable_if, void_>::type = void_() + , typename enable_if, void_>::type = void_()) : base(base::from_iterator(fusion::begin(seq))) {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp index a65fa4ac..e99e2b20 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp @@ -102,8 +102,8 @@ namespace boost { namespace fusion { template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if >::type* /*dummy*/ = 0 - , typename enable_if >::type* /*dummy*/ = 0) + , typename disable_if, void_>::type = void_() + , typename enable_if, void_>::type = void_()) : base(base::from_iterator(fusion::begin(seq))) {} @@ -133,7 +133,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if >::type* /*dummy*/ = 0 + , typename enable_if, void_>::type = void_() ) : base(BOOST_FUSION_FWD_ELEM(T0_, t0), detail::nil_keyed_element()) {} @@ -146,7 +146,8 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) deque(deque&& seq , typename disable_if< is_convertible, T0> - >::type* /*dummy*/ = 0) + , void_ + >::type = void_()) : base(std::forward>(seq)) {} template @@ -180,7 +181,7 @@ FUSION_HASH endif typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty > >::type* /*dummy*/ = 0) BOOST_NOEXCEPT + , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp index e05b62eb..a176880c 100644 --- a/include/boost/fusion/container/list/cons.hpp +++ b/include/boost/fusion/container/list/cons.hpp @@ -9,6 +9,7 @@ #define FUSION_CONS_07172005_0843 #include +#include #include #include #include @@ -34,7 +35,6 @@ namespace boost { namespace fusion { - struct void_; struct cons_tag; struct forward_traversal_tag; struct fusion_sequence_tag; @@ -82,7 +82,8 @@ namespace boost { namespace fusion traits::is_sequence , mpl::not_ > , mpl::not_ > > // use copy to car instead - >::type* /*dummy*/ = 0 + , void_ + >::type = void_() ) : car(*fusion::begin(seq)) , cdr(fusion::next(fusion::begin(seq)), mpl::true_()) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/list.hpp b/include/boost/fusion/container/list/detail/cpp03/list.hpp index b39489b0..14f94939 100644 --- a/include/boost/fusion/container/list/detail/cpp03/list.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/list.hpp @@ -8,6 +8,7 @@ #define FUSION_LIST_07172005_1153 #include +#include #include #include #include @@ -61,7 +62,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : inherited_type(rhs) {} // Expand a couple of forwarding constructors for arguments diff --git a/include/boost/fusion/container/map/map.hpp b/include/boost/fusion/container/map/map.hpp index e90d28a9..2c90a96d 100644 --- a/include/boost/fusion/container/map/map.hpp +++ b/include/boost/fusion/container/map/map.hpp @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -68,21 +69,21 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED map(Sequence const& seq - , typename enable_if>::type* /*dummy*/ = 0) + , typename enable_if, void_>::type = void_()) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template BOOST_FUSION_GPU_ENABLED map(Sequence& seq - , typename enable_if>::type* /*dummy*/ = 0) + , typename enable_if, void_>::type = void_()) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template BOOST_FUSION_GPU_ENABLED map(Sequence&& seq - , typename enable_if>::type* /*dummy*/ = 0) + , typename enable_if, void_>::type = void_()) : base_type(begin(seq), detail::map_impl_from_iterator()) {} diff --git a/include/boost/fusion/container/set/detail/cpp03/set.hpp b/include/boost/fusion/container/set/detail/cpp03/set.hpp index 46191c5c..3645a413 100644 --- a/include/boost/fusion/container/set/detail/cpp03/set.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/set.hpp @@ -8,6 +8,7 @@ #define FUSION_SET_09162005_1104 #include +#include #include #include #include @@ -47,7 +48,6 @@ namespace boost { namespace fusion { - struct void_; struct fusion_sequence_tag; template @@ -72,7 +72,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : data(rhs) {} #include diff --git a/include/boost/fusion/container/set/set.hpp b/include/boost/fusion/container/set/set.hpp index 12fd8115..ae660331 100644 --- a/include/boost/fusion/container/set/set.hpp +++ b/include/boost/fusion/container/set/set.hpp @@ -21,6 +21,7 @@ // C++11 interface /////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -60,8 +61,8 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs, - typename enable_if >::type* = 0, - typename enable_if >::type* = 0) + typename enable_if, void_>::type = void_(), + typename enable_if, void_>::type = void_()) : data(rhs) {} template @@ -102,8 +103,8 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED set(Sequence&& rhs, - typename enable_if >::type* = 0, - typename enable_if >::type* = 0) + typename enable_if, void_>::type = void_(), + typename enable_if, void_>::type = void_()) : data(std::forward(rhs)) {} template diff --git a/include/boost/fusion/container/vector/detail/cpp03/vector.hpp b/include/boost/fusion/container/vector/detail/cpp03/vector.hpp index 5dcd6886..a8cc9adb 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/vector.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/vector.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -118,7 +119,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if >::type* = 0) + typename boost::enable_if, void_>::type = void_()) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} // Expand a couple of forwarding constructors for arguments diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 845a019e..52f8afa3 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -24,6 +24,7 @@ /////////////////////////////////////////////////////////////////////////////// #include #include +#include #include #include #include @@ -164,7 +165,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED store(U&& rhs - , typename disable_if::type, store> >::type* = 0) + , typename disable_if::type, store>, void_>::type = void_()) : elem(std::forward(rhs)) {} From 3919f3ed73d8b2fac04808fb014df933cd41f2ac Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 1 Dec 2015 01:16:01 +0900 Subject: [PATCH 02/18] Fix missing header. --- include/boost/fusion/algorithm/transformation/zip.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/fusion/algorithm/transformation/zip.hpp b/include/boost/fusion/algorithm/transformation/zip.hpp index e94efc81..0775a429 100644 --- a/include/boost/fusion/algorithm/transformation/zip.hpp +++ b/include/boost/fusion/algorithm/transformation/zip.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include From 2492ff9b2593184cbf4b26ea27abfc749cbfb665 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 1 Dec 2015 01:26:08 +0900 Subject: [PATCH 03/18] regen --- .../deque/detail/cpp03/preprocessed/deque10.hpp | 11 ++++++----- .../deque/detail/cpp03/preprocessed/deque20.hpp | 11 ++++++----- .../deque/detail/cpp03/preprocessed/deque30.hpp | 11 ++++++----- .../deque/detail/cpp03/preprocessed/deque40.hpp | 11 ++++++----- .../deque/detail/cpp03/preprocessed/deque50.hpp | 11 ++++++----- .../list/detail/cpp03/preprocessed/list10.hpp | 2 +- .../list/detail/cpp03/preprocessed/list20.hpp | 2 +- .../list/detail/cpp03/preprocessed/list30.hpp | 2 +- .../list/detail/cpp03/preprocessed/list40.hpp | 2 +- .../list/detail/cpp03/preprocessed/list50.hpp | 2 +- .../container/set/detail/cpp03/preprocessed/set10.hpp | 3 +-- .../container/set/detail/cpp03/preprocessed/set20.hpp | 3 +-- .../container/set/detail/cpp03/preprocessed/set30.hpp | 3 +-- .../container/set/detail/cpp03/preprocessed/set40.hpp | 3 +-- .../container/set/detail/cpp03/preprocessed/set50.hpp | 3 +-- .../vector/detail/cpp03/preprocessed/vvector10.hpp | 2 +- .../vector/detail/cpp03/preprocessed/vvector20.hpp | 2 +- .../vector/detail/cpp03/preprocessed/vvector30.hpp | 2 +- .../vector/detail/cpp03/preprocessed/vvector40.hpp | 2 +- .../vector/detail/cpp03/preprocessed/vvector50.hpp | 2 +- 20 files changed, 45 insertions(+), 45 deletions(-) diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque10.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque10.hpp index 95cd8c1c..082c9a79 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque10.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque10.hpp @@ -202,8 +202,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if >::type* = 0 - , typename enable_if >::type* = 0) + , typename disable_if, void_>::type = void_() + , typename enable_if, void_>::type = void_()) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -226,7 +226,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if >::type* = 0 + , typename enable_if, void_>::type = void_() ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -239,7 +239,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - >::type* = 0) + , void_ + >::type = void_()) : base(std::forward>(seq)) {} template @@ -267,7 +268,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty > >::type* = 0) BOOST_NOEXCEPT + , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque20.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque20.hpp index ad069451..64a516d1 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque20.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque20.hpp @@ -382,8 +382,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if >::type* = 0 - , typename enable_if >::type* = 0) + , typename disable_if, void_>::type = void_() + , typename enable_if, void_>::type = void_()) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -406,7 +406,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if >::type* = 0 + , typename enable_if, void_>::type = void_() ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -419,7 +419,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - >::type* = 0) + , void_ + >::type = void_()) : base(std::forward>(seq)) {} template @@ -447,7 +448,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty > >::type* = 0) BOOST_NOEXCEPT + , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque30.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque30.hpp index 44a5b2b1..05cae20d 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque30.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque30.hpp @@ -562,8 +562,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if >::type* = 0 - , typename enable_if >::type* = 0) + , typename disable_if, void_>::type = void_() + , typename enable_if, void_>::type = void_()) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -586,7 +586,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if >::type* = 0 + , typename enable_if, void_>::type = void_() ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -599,7 +599,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - >::type* = 0) + , void_ + >::type = void_()) : base(std::forward>(seq)) {} template @@ -627,7 +628,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty > >::type* = 0) BOOST_NOEXCEPT + , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque40.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque40.hpp index e642288e..8cf0f833 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque40.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque40.hpp @@ -742,8 +742,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if >::type* = 0 - , typename enable_if >::type* = 0) + , typename disable_if, void_>::type = void_() + , typename enable_if, void_>::type = void_()) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -766,7 +766,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if >::type* = 0 + , typename enable_if, void_>::type = void_() ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -779,7 +779,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - >::type* = 0) + , void_ + >::type = void_()) : base(std::forward>(seq)) {} template @@ -807,7 +808,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty > >::type* = 0) BOOST_NOEXCEPT + , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque50.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque50.hpp index a387708b..c6e90120 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque50.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque50.hpp @@ -922,8 +922,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if >::type* = 0 - , typename enable_if >::type* = 0) + , typename disable_if, void_>::type = void_() + , typename enable_if, void_>::type = void_()) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -946,7 +946,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if >::type* = 0 + , typename enable_if, void_>::type = void_() ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -959,7 +959,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - >::type* = 0) + , void_ + >::type = void_()) : base(std::forward>(seq)) {} template @@ -987,7 +988,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty > >::type* = 0) BOOST_NOEXCEPT + , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list10.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list10.hpp index 47db8f58..f66fe303 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list10.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list10.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list20.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list20.hpp index 8eb7d2d2..3486ef18 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list20.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list20.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list30.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list30.hpp index fb24e8d4..b9e251a8 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list30.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list30.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list40.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list40.hpp index 49437dee..a6825899 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list40.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list40.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list50.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list50.hpp index 3ebbf195..33cb1246 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list50.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list50.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set10.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set10.hpp index d2eba4c8..0c279756 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set10.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set10.hpp @@ -8,7 +8,6 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct void_; struct fusion_sequence_tag; template struct set : sequence_base > @@ -27,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set20.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set20.hpp index 500e726e..2d224452 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set20.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set20.hpp @@ -8,7 +8,6 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct void_; struct fusion_sequence_tag; template struct set : sequence_base > @@ -27,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set30.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set30.hpp index 6c92bead..586d1ccf 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set30.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set30.hpp @@ -8,7 +8,6 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct void_; struct fusion_sequence_tag; template struct set : sequence_base > @@ -27,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set40.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set40.hpp index d3c3e5eb..6e972413 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set40.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set40.hpp @@ -8,7 +8,6 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct void_; struct fusion_sequence_tag; template struct set : sequence_base > @@ -27,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set50.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set50.hpp index 1d2dfd44..09377d32 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set50.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set50.hpp @@ -8,7 +8,6 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct void_; struct fusion_sequence_tag; template struct set : sequence_base > @@ -27,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if >::type* = 0) + , typename boost::enable_if, void_>::type = void_()) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10.hpp index cd2bd58b..48a94579 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if >::type* = 0) + typename boost::enable_if, void_>::type = void_()) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20.hpp index 809485fe..50b79f49 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if >::type* = 0) + typename boost::enable_if, void_>::type = void_()) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30.hpp index 3f75a05f..e222a528 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if >::type* = 0) + typename boost::enable_if, void_>::type = void_()) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40.hpp index 6c7654cc..713465f7 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if >::type* = 0) + typename boost::enable_if, void_>::type = void_()) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50.hpp index 47fce0e1..80597591 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if >::type* = 0) + typename boost::enable_if, void_>::type = void_()) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} From 64b8406c16651305d1414b6916467c338280a499 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Thu, 10 Dec 2015 17:06:04 +0900 Subject: [PATCH 04/18] Introduce detail::enabler instead of fusion::void_. --- .../boost/fusion/container/deque/deque.hpp | 7 +++--- .../container/deque/detail/cpp03/deque.hpp | 13 ++++++----- .../detail/cpp03/preprocessed/deque10.hpp | 12 +++++----- .../detail/cpp03/preprocessed/deque20.hpp | 12 +++++----- .../detail/cpp03/preprocessed/deque30.hpp | 12 +++++----- .../detail/cpp03/preprocessed/deque40.hpp | 12 +++++----- .../detail/cpp03/preprocessed/deque50.hpp | 12 +++++----- include/boost/fusion/container/list/cons.hpp | 5 +++-- .../container/list/detail/cpp03/list.hpp | 3 ++- .../list/detail/cpp03/preprocessed/list10.hpp | 2 +- .../list/detail/cpp03/preprocessed/list20.hpp | 2 +- .../list/detail/cpp03/preprocessed/list30.hpp | 2 +- .../list/detail/cpp03/preprocessed/list40.hpp | 2 +- .../list/detail/cpp03/preprocessed/list50.hpp | 2 +- include/boost/fusion/container/map/map.hpp | 7 +++--- .../set/detail/cpp03/preprocessed/set10.hpp | 2 +- .../set/detail/cpp03/preprocessed/set20.hpp | 2 +- .../set/detail/cpp03/preprocessed/set30.hpp | 2 +- .../set/detail/cpp03/preprocessed/set40.hpp | 2 +- .../set/detail/cpp03/preprocessed/set50.hpp | 2 +- .../fusion/container/set/detail/cpp03/set.hpp | 3 ++- include/boost/fusion/container/set/set.hpp | 9 ++++---- .../detail/cpp03/preprocessed/vvector10.hpp | 2 +- .../detail/cpp03/preprocessed/vvector20.hpp | 2 +- .../detail/cpp03/preprocessed/vvector30.hpp | 2 +- .../detail/cpp03/preprocessed/vvector40.hpp | 2 +- .../detail/cpp03/preprocessed/vvector50.hpp | 2 +- .../container/vector/detail/cpp03/vector.hpp | 3 ++- .../boost/fusion/container/vector/vector.hpp | 3 ++- .../boost/fusion/support/detail/enabler.hpp | 22 +++++++++++++++++++ 30 files changed, 98 insertions(+), 67 deletions(-) create mode 100644 include/boost/fusion/support/detail/enabler.hpp diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index 3bf0cd38..a282a701 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -22,6 +22,7 @@ /////////////////////////////////////////////////////////////////////////////// #include #include +#include #include #include #include @@ -60,7 +61,7 @@ namespace boost { namespace fusion typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty>, void_>::type = void_()) BOOST_NOEXCEPT + , result_of::empty>, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED @@ -150,8 +151,8 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(Sequence const& seq - , typename disable_if, void_>::type = void_() - , typename enable_if, void_>::type = void_()) + , typename disable_if, detail::enabler_>::type = detail::enabler + , typename enable_if, detail::enabler_>::type = detail::enabler) : base(base::from_iterator(fusion::begin(seq))) {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp index e99e2b20..8cffe6b9 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp @@ -35,6 +35,7 @@ #include #include +#include #include #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) @@ -102,8 +103,8 @@ namespace boost { namespace fusion { template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if, void_>::type = void_() - , typename enable_if, void_>::type = void_()) + , typename disable_if, detail::enabler_>::type = detail::enabler + , typename enable_if, detail::enabler_>::type = detail::enabler) : base(base::from_iterator(fusion::begin(seq))) {} @@ -133,7 +134,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if, void_>::type = void_() + , typename enable_if, detail::enabler_>::type = detail::enabler ) : base(BOOST_FUSION_FWD_ELEM(T0_, t0), detail::nil_keyed_element()) {} @@ -146,8 +147,8 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) deque(deque&& seq , typename disable_if< is_convertible, T0> - , void_ - >::type = void_()) + , detail::enabler_ + >::type = detail::enabler) : base(std::forward>(seq)) {} template @@ -181,7 +182,7 @@ FUSION_HASH endif typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT + , result_of::empty >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque10.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque10.hpp index 082c9a79..8267496c 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque10.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque10.hpp @@ -202,8 +202,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if, void_>::type = void_() - , typename enable_if, void_>::type = void_()) + , typename disable_if, detail::enabler_>::type = detail::enabler + , typename enable_if, detail::enabler_>::type = detail::enabler) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -226,7 +226,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if, void_>::type = void_() + , typename enable_if, detail::enabler_>::type = detail::enabler ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -239,8 +239,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - , void_ - >::type = void_()) + , detail::enabler_ + >::type = detail::enabler) : base(std::forward>(seq)) {} template @@ -268,7 +268,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT + , result_of::empty >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque20.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque20.hpp index 64a516d1..a3adee14 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque20.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque20.hpp @@ -382,8 +382,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if, void_>::type = void_() - , typename enable_if, void_>::type = void_()) + , typename disable_if, detail::enabler_>::type = detail::enabler + , typename enable_if, detail::enabler_>::type = detail::enabler) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -406,7 +406,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if, void_>::type = void_() + , typename enable_if, detail::enabler_>::type = detail::enabler ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -419,8 +419,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - , void_ - >::type = void_()) + , detail::enabler_ + >::type = detail::enabler) : base(std::forward>(seq)) {} template @@ -448,7 +448,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT + , result_of::empty >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque30.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque30.hpp index 05cae20d..4c56d9ff 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque30.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque30.hpp @@ -562,8 +562,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if, void_>::type = void_() - , typename enable_if, void_>::type = void_()) + , typename disable_if, detail::enabler_>::type = detail::enabler + , typename enable_if, detail::enabler_>::type = detail::enabler) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -586,7 +586,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if, void_>::type = void_() + , typename enable_if, detail::enabler_>::type = detail::enabler ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -599,8 +599,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - , void_ - >::type = void_()) + , detail::enabler_ + >::type = detail::enabler) : base(std::forward>(seq)) {} template @@ -628,7 +628,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT + , result_of::empty >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque40.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque40.hpp index 8cf0f833..bb827e93 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque40.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque40.hpp @@ -742,8 +742,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if, void_>::type = void_() - , typename enable_if, void_>::type = void_()) + , typename disable_if, detail::enabler_>::type = detail::enabler + , typename enable_if, detail::enabler_>::type = detail::enabler) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -766,7 +766,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if, void_>::type = void_() + , typename enable_if, detail::enabler_>::type = detail::enabler ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -779,8 +779,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - , void_ - >::type = void_()) + , detail::enabler_ + >::type = detail::enabler) : base(std::forward>(seq)) {} template @@ -808,7 +808,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT + , result_of::empty >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque50.hpp b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque50.hpp index c6e90120..af40651f 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque50.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque50.hpp @@ -922,8 +922,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq - , typename disable_if, void_>::type = void_() - , typename enable_if, void_>::type = void_()) + , typename disable_if, detail::enabler_>::type = detail::enabler + , typename enable_if, detail::enabler_>::type = detail::enabler) : base(base::from_iterator(fusion::begin(seq))) {} template @@ -946,7 +946,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ template BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 - , typename enable_if, void_>::type = void_() + , typename enable_if, detail::enabler_>::type = detail::enabler ) : base(std::forward( t0), detail::nil_keyed_element()) {} @@ -959,8 +959,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ deque(deque&& seq , typename disable_if< is_convertible, T0> - , void_ - >::type = void_()) + , detail::enabler_ + >::type = detail::enabler) : base(std::forward>(seq)) {} template @@ -988,7 +988,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_ typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty >, void_>::type = void_()) BOOST_NOEXCEPT + , result_of::empty >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() BOOST_NOEXCEPT {} diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp index a176880c..0dd91b0c 100644 --- a/include/boost/fusion/container/list/cons.hpp +++ b/include/boost/fusion/container/list/cons.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -82,8 +83,8 @@ namespace boost { namespace fusion traits::is_sequence , mpl::not_ > , mpl::not_ > > // use copy to car instead - , void_ - >::type = void_() + , detail::enabler_ + >::type = detail::enabler ) : car(*fusion::begin(seq)) , cdr(fusion::next(fusion::begin(seq)), mpl::true_()) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/list.hpp b/include/boost/fusion/container/list/detail/cpp03/list.hpp index 14f94939..048d59b6 100644 --- a/include/boost/fusion/container/list/detail/cpp03/list.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/list.hpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -62,7 +63,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : inherited_type(rhs) {} // Expand a couple of forwarding constructors for arguments diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list10.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list10.hpp index f66fe303..818dc528 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list10.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list10.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list20.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list20.hpp index 3486ef18..3c3c3f6c 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list20.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list20.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list30.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list30.hpp index b9e251a8..143dce67 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list30.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list30.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list40.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list40.hpp index a6825899..00e16041 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list40.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list40.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list50.hpp b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list50.hpp index 33cb1246..b948f40a 100644 --- a/include/boost/fusion/container/list/detail/cpp03/preprocessed/list50.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/preprocessed/list50.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/map/map.hpp b/include/boost/fusion/container/map/map.hpp index 2c90a96d..ec9e58d3 100644 --- a/include/boost/fusion/container/map/map.hpp +++ b/include/boost/fusion/container/map/map.hpp @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -69,21 +70,21 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED map(Sequence const& seq - , typename enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template BOOST_FUSION_GPU_ENABLED map(Sequence& seq - , typename enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template BOOST_FUSION_GPU_ENABLED map(Sequence&& seq - , typename enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : base_type(begin(seq), detail::map_impl_from_iterator()) {} diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set10.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set10.hpp index 0c279756..74e84717 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set10.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set10.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set20.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set20.hpp index 2d224452..cab21048 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set20.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set20.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set30.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set30.hpp index 586d1ccf..2ac448be 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set30.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set30.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set40.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set40.hpp index 6e972413..76112505 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set40.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set40.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set50.hpp b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set50.hpp index 09377d32..32954f42 100644 --- a/include/boost/fusion/container/set/detail/cpp03/preprocessed/set50.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/preprocessed/set50.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : data(rhs) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit diff --git a/include/boost/fusion/container/set/detail/cpp03/set.hpp b/include/boost/fusion/container/set/detail/cpp03/set.hpp index 3645a413..274a36eb 100644 --- a/include/boost/fusion/container/set/detail/cpp03/set.hpp +++ b/include/boost/fusion/container/set/detail/cpp03/set.hpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -72,7 +73,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs - , typename boost::enable_if, void_>::type = void_()) + , typename enable_if, detail::enabler_>::type = detail::enabler) : data(rhs) {} #include diff --git a/include/boost/fusion/container/set/set.hpp b/include/boost/fusion/container/set/set.hpp index ae660331..f03488b1 100644 --- a/include/boost/fusion/container/set/set.hpp +++ b/include/boost/fusion/container/set/set.hpp @@ -22,6 +22,7 @@ /////////////////////////////////////////////////////////////////////////////// #include #include +#include #include #include #include @@ -61,8 +62,8 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs, - typename enable_if, void_>::type = void_(), - typename enable_if, void_>::type = void_()) + typename enable_if, detail::enabler_>::type = detail::enabler, + typename enable_if, detail::enabler_>::type = detail::enabler) : data(rhs) {} template @@ -103,8 +104,8 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED set(Sequence&& rhs, - typename enable_if, void_>::type = void_(), - typename enable_if, void_>::type = void_()) + typename enable_if, detail::enabler_>::type = detail::enabler, + typename enable_if, detail::enabler_>::type = detail::enabler) : data(std::forward(rhs)) {} template diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10.hpp index 48a94579..0b4e2574 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if, void_>::type = void_()) + typename enable_if, detail::enabler_>::type = detail::enabler) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20.hpp index 50b79f49..44e8832f 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if, void_>::type = void_()) + typename enable_if, detail::enabler_>::type = detail::enabler) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30.hpp index e222a528..13f7a626 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if, void_>::type = void_()) + typename enable_if, detail::enabler_>::type = detail::enabler) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40.hpp index 713465f7..1730d988 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if, void_>::type = void_()) + typename enable_if, detail::enabler_>::type = detail::enabler) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50.hpp b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50.hpp index 80597591..fb334d1a 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if, void_>::type = void_()) + typename enable_if, detail::enabler_>::type = detail::enabler) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/vector.hpp b/include/boost/fusion/container/vector/detail/cpp03/vector.hpp index a8cc9adb..8a7a4e5d 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/vector.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/vector.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -119,7 +120,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED vector(Sequence const& rhs, - typename boost::enable_if, void_>::type = void_()) + typename enable_if, detail::enabler_>::type = detail::enabler) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} // Expand a couple of forwarding constructors for arguments diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 52f8afa3..9d0f97bd 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -165,7 +166,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED store(U&& rhs - , typename disable_if::type, store>, void_>::type = void_()) + , typename disable_if::type, store>, detail::enabler_>::type = detail::enabler) : elem(std::forward(rhs)) {} diff --git a/include/boost/fusion/support/detail/enabler.hpp b/include/boost/fusion/support/detail/enabler.hpp new file mode 100644 index 00000000..9dd8b4bb --- /dev/null +++ b/include/boost/fusion/support/detail/enabler.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2015 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) +==============================================================================*/ + +#ifndef BOOST_FUSION_SUPPORT_DETAIL_ENABLER_12102015_0346 +#define BOOST_FUSION_SUPPORT_DETAIL_ENABLER_12102015_0346 + +#include + +namespace boost { namespace fusion { namespace detail +{ + +struct enabler_ {}; +BOOST_STATIC_CONSTEXPR enabler_ enabler = {}; + +}}} + +#endif + From b46aad996ad7f6fcf81109679f277b21556455e3 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Thu, 11 Feb 2016 23:56:07 +0900 Subject: [PATCH 05/18] Remove trailing void_ support on variadic vector. --- .../container/generation/make_vector.hpp | 34 ++++--------------- .../boost/fusion/container/vector/vector.hpp | 33 +++++------------- 2 files changed, 15 insertions(+), 52 deletions(-) diff --git a/include/boost/fusion/container/generation/make_vector.hpp b/include/boost/fusion/container/generation/make_vector.hpp index cd3b992b..4e4bcb2d 100644 --- a/include/boost/fusion/container/generation/make_vector.hpp +++ b/include/boost/fusion/container/generation/make_vector.hpp @@ -30,33 +30,13 @@ namespace boost { namespace fusion template struct make_vector { - // make `make_vector' into `make_vector' - template struct trim_void; - - template - struct trim_void > - { - typedef vector type; - }; - - template - struct trim_void, void_, Tail...> - : trim_void > { }; - - template - struct trim_void, Head, Tail...> - : trim_void, Tail...> { }; - - typedef - typename trim_void< - vector<> - , typename detail::as_fusion_element< - typename remove_const< - typename remove_reference::type - >::type - >::type... - >::type - type; + typedef vector< + typename detail::as_fusion_element< + typename remove_const< + typename remove_reference::type + >::type + >::type... + > type; }; } diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 9d0f97bd..6c9c44fe 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -276,37 +276,20 @@ namespace boost { namespace fusion static BOOST_FUSION_GPU_ENABLED mpl::identity value_at_impl(store*); }; - - template - struct trim_void_; - - template - struct trim_void_ > - { - typedef vector_data< - typename detail::make_index_sequence::type - , T... - > type; - }; - - template - struct trim_void_, void_, Tail...> - : trim_void_ > {}; - - template - struct trim_void_, Head, Tail...> - : trim_void_, Tail...> {}; - - template - struct trim_void : trim_void_, T...> {}; } // namespace boost::fusion::vector_detail // This class provides backward compatibility: vector. template struct vector - : vector_detail::trim_void::type + : vector_detail::vector_data< + typename detail::make_index_sequence::type + , T... + > { - typedef typename vector_detail::trim_void::type base; + typedef vector_detail::vector_data< + typename detail::make_index_sequence::type + , T... + > base; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector() From b88daeb6977156fd418a2d5778a27f461cecbefc Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sat, 13 Feb 2016 11:57:41 +0900 Subject: [PATCH 06/18] Detect std::integer_sequence availability. It will allow to reuse compiler cache easier. --- .../fusion/support/detail/index_sequence.hpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/boost/fusion/support/detail/index_sequence.hpp b/include/boost/fusion/support/detail/index_sequence.hpp index 1b596e72..e86def00 100644 --- a/include/boost/fusion/support/detail/index_sequence.hpp +++ b/include/boost/fusion/support/detail/index_sequence.hpp @@ -12,8 +12,27 @@ #include #include +// GCC5 has O(logN) implementation, see https://gcc.gnu.org/PR66059 . +#if (defined(__cpp_lib_integer_sequence) && __cpp_lib_integer_sequence >= 201304) \ + || (defined(BOOST_LIBSTDCXX_VERSION) \ + && BOOST_LIBSTDCXX_VERSION >= 500000 && __cplusplus >= 201402) +#include +#define BOOST_FUSION_STDLIB_HAS_INTEGER_SEQUENCE +#endif + namespace boost { namespace fusion { namespace detail { +#ifdef BOOST_FUSION_STDLIB_HAS_INTEGER_SEQUENCE + // Use aliasing templates without checking availability, the compiler should work. + template + using index_sequence = std::index_sequence; + + template + struct make_index_sequence + { + using type = std::make_index_sequence; + }; +#else template struct index_sequence { @@ -53,6 +72,7 @@ namespace boost { namespace fusion { namespace detail struct make_index_sequence<0> : index_sequence<> {}; +#endif }}} #endif From 2e466ac0548ae86dd9c9d58951070f09e29c4b25 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 31 Mar 2015 08:18:46 +0200 Subject: [PATCH 07/18] Remove BOOST_PP_IS_EMPTY in favor of BOOST_MPL_PP_TOKEN_EQUAL and added auto as synonym for BOOST_FUSION_ADAPT_AUTO. Fix ticket https://svn.boost.org/trac/boost/ticket/11157 BOOST_MPL_PP_TOKEN_EQUAL is now used to check if auto/BOOST_FUSION_ADAPT_AUTO was provided as type, telling to deduce members types. --- .../detail/adapt_base_assoc_attr_filler.hpp | 7 ++--- .../adt/detail/adapt_base_attr_filler.hpp | 16 ++++++++---- .../adapted/struct/detail/adapt_auto.hpp | 5 ++-- .../detail/adapt_base_assoc_attr_filler.hpp | 7 ++--- .../struct/detail/adapt_base_attr_filler.hpp | 10 ++++--- test/sequence/adapt_adt.cpp | 15 ++++++----- test/sequence/adapt_adt_named.cpp | 2 +- test/sequence/adapt_assoc_adt.cpp | 2 +- test/sequence/adapt_assoc_adt_named.cpp | 26 ++++++++++++++----- test/sequence/adapt_assoc_struct.cpp | 6 ++--- test/sequence/adapt_assoc_struct_named.cpp | 26 ++++++++++++++----- test/sequence/adapt_assoc_tpl_adt.cpp | 2 +- test/sequence/adapt_assoc_tpl_struct.cpp | 4 +-- test/sequence/adapt_struct.cpp | 13 +++++----- test/sequence/adapt_struct_named.cpp | 6 ++--- test/sequence/adapt_tpl_adt.cpp | 2 +- test/sequence/adapt_tpl_struct.cpp | 6 ++--- 17 files changed, 97 insertions(+), 58 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp index b9c93b7d..1093577e 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp @@ -10,12 +10,13 @@ #include +#include #include +#include + #include #include -#include -#include #if BOOST_PP_VARIADICS @@ -41,7 +42,7 @@ BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 #define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(A), \ + BOOST_PP_IF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \ ((3, (C,D,E))), \ ((5, (A,B,C,D,E))) \ ) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp index 09bd4014..91cc8464 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp @@ -9,15 +9,18 @@ #define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP #include + +#include + #include +#include + #include #include #include -#include #include #include -#include #include #include #include @@ -50,8 +53,11 @@ # define BOOST_FUSION_ADAPT_ADT_FILLER(...) \ BOOST_PP_IF( \ BOOST_PP_OR( \ - BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ - BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__))), \ + BOOST_MPL_PP_TOKEN_EQUAL(auto, \ + BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ + BOOST_MPL_PP_TOKEN_EQUAL(auto, \ + BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__))), \ + \ BOOST_FUSION_ADAPT_ADT_WRAP_ATTR( \ BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__), \ BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(__VA_ARGS__) \ @@ -80,7 +86,7 @@ # define BOOST_FUSION_ADAPT_ADT_FILLER_1_END # define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A, B, C, D) \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(A), \ + BOOST_PP_IF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \ ((2, (C,D))), \ ((4, (A,B,C,D))) \ ) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp b/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp index 5178150b..71a542c7 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp @@ -8,8 +8,7 @@ #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP -#include - -#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() +#define BOOST_FUSION_ADAPT_AUTO auto +#define BOOST_MPL_PP_TOKEN_EQUAL_auto(x) x #endif diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp index c75e83c3..cbd9c011 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp @@ -10,13 +10,14 @@ #include +#include #include +#include + #include #include #include -#include -#include #if BOOST_PP_VARIADICS @@ -43,7 +44,7 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ + BOOST_PP_IF(BOOST_MPL_PP_TOKEN_EQUAL(auto, X), \ ((2, (Y,Z))), \ ((3, (X,Y,Z))) \ ) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp index 7a83bb34..b4abe113 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp @@ -9,12 +9,14 @@ #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP #include + +#include #include -#include +#include + #include #include -#include #include #include #include @@ -32,7 +34,7 @@ #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END #define BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X, Y) \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ + BOOST_PP_IF(BOOST_MPL_PP_TOKEN_EQUAL(auto, BOOST_PP_EXPAND(X)), \ ((1, (Y))), \ ((2, (X,Y))) \ ) @@ -51,7 +53,7 @@ BOOST_PP_CAT( BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END), \ BOOST_PP_IF(BOOST_PP_IS_EMPTY(elem), \ BOOST_PP_EMPTY(), \ - BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(BOOST_FUSION_ADAPT_AUTO,elem))\ + BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(auto,elem))\ ) # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(VA_ARGS_SEQ) \ diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index bf5d4ca0..bdaef73e 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -103,7 +103,8 @@ namespace ns BOOST_FUSION_ADAPT_ADT( ns::point, (int, int, obj.get_x(), obj.set_x(val)) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) + // Mixing auto & BOOST_FUSION_ADAPT_AUTO to test backward compatibility + (auto, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) (obj.get_z(), obj.set_z(val)) ) @@ -128,23 +129,23 @@ namespace ns BOOST_FUSION_ADAPT_ADT( ns::point, (int, int, obj.get_x(), obj.set_x(val)) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) + (auto, auto, obj.get_y(), obj.set_y(val)) + (auto, auto, obj.get_z(), obj.set_z(val)) ) # if !BOOST_WORKAROUND(__GNUC__,<4) BOOST_FUSION_ADAPT_ADT( ns::point_with_private_members, - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_x(), obj.set_x(val)) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) + (auto, auto, obj.get_x(), obj.set_x(val)) + (auto, auto, obj.get_y(), obj.set_y(val)) + (auto, auto, obj.get_z(), obj.set_z(val)) ) # endif BOOST_FUSION_ADAPT_ADT( ns::name, (const std::string&, const std::string&, obj.get_last(), obj.set_last(val)) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_first(), obj.set_first(val)) + (BOOST_FUSION_ADAPT_AUTO, auto, obj.get_first(), obj.set_first(val)) ) #endif diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index f7e115aa..4a0084dc 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -72,7 +72,7 @@ BOOST_FUSION_ADAPT_ADT_NAMED( ns::point, point, (int, int, obj.get_x(), obj.set_x(val)) (int, int, obj.get_y(), obj.set_y(val)) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) + (auto, auto, obj.get_z(), obj.set_z(val)) ) #endif // BOOST_PP_VARIADICS diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index fca3941d..6ff1733f 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -65,7 +65,7 @@ BOOST_FUSION_ADAPT_ASSOC_ADT( ns::point, (int, int, obj.get_x(), obj.set_x(val), ns::x_member) (int, int, obj.get_y(), obj.set_y(val), ns::y_member) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val), ns::z_member) + (auto, auto, obj.get_z(), obj.set_z(val), ns::z_member) ) #endif diff --git a/test/sequence/adapt_assoc_adt_named.cpp b/test/sequence/adapt_assoc_adt_named.cpp index d685528d..c71cc163 100644 --- a/test/sequence/adapt_assoc_adt_named.cpp +++ b/test/sequence/adapt_assoc_adt_named.cpp @@ -45,12 +45,26 @@ namespace ns }; } -BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED( - ns::point, - point, - (int, int, obj.get_x(), obj.set_x(val), ns::x_member) - (int, int, obj.get_y(), obj.set_y(val), ns::y_member) -) +#if BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED( + ns::point, + point, + (obj.get_x(), obj.set_x(val), ns::x_member) + (int, int, obj.get_y(), obj.set_y(val), ns::y_member) + ) + +#else // BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED( + ns::point, + point, + (auto, auto, obj.get_x(), obj.set_x(val), ns::x_member) + (int, int, obj.get_y(), obj.set_y(val), ns::y_member) + ) + +#endif + class empty_adt{}; BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(empty_adt, renamed_empty_adt,) diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index 6bb4a8ee..b27d7ff3 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -57,15 +57,15 @@ namespace ns BOOST_FUSION_ADAPT_ASSOC_STRUCT( ns::point, (x, ns::x_member) - (y, ns::y_member) + (auto, y, ns::y_member) (int, z, ns::z_member) ) #else // BOOST_PP_VARIADICS BOOST_FUSION_ADAPT_ASSOC_STRUCT( ns::point, - (BOOST_FUSION_ADAPT_AUTO, x, ns::x_member) - (BOOST_FUSION_ADAPT_AUTO, y, ns::y_member) + (auto, x, ns::x_member) + (auto, y, ns::y_member) (int, z, ns::z_member) ) diff --git a/test/sequence/adapt_assoc_struct_named.cpp b/test/sequence/adapt_assoc_struct_named.cpp index fd7fdc50..541ed8fc 100644 --- a/test/sequence/adapt_assoc_struct_named.cpp +++ b/test/sequence/adapt_assoc_struct_named.cpp @@ -31,12 +31,26 @@ namespace ns }; } -BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( - ns::point, - point, - (int, x, ns::x_member) - (int, y, ns::y_member) -) + +#if BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( + ns::point, + point, + (x, ns::x_member) + (auto, y, ns::y_member) + ) + +#else // BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( + ns::point, + point, + (int, x, ns::x_member) + (auto, y, ns::y_member) + ) + +#endif struct empty_struct {}; BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(empty_struct, renamed_empty_struct,); diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index e0b89dca..092038cb 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -66,7 +66,7 @@ BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( (ns::point)(X)(Y)(Z), (X, X, obj.get_x(), obj.set_x(val), ns::x_member) (Y, Y, obj.get_y(), obj.set_y(val), ns::y_member) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val), ns::z_member) + (auto, auto, obj.get_z(), obj.set_z(val), ns::z_member) ) #endif diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index a949dad0..184aef36 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -55,7 +55,7 @@ namespace ns (X)(Y)(Z), (ns::point)(X)(Y)(Z), (int, x, ns::x_member) - (Y, y, ns::y_member) + (auto, y, ns::y_member) (z, ns::z_member) ) @@ -65,7 +65,7 @@ namespace ns (ns::point)(X)(Y)(Z), (int, x, ns::x_member) (Y, y, ns::y_member) - (BOOST_FUSION_ADAPT_AUTO, z, ns::z_member) + (auto, z, ns::z_member) ) #endif diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index e4c8f6ee..5e2e7d3f 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -104,7 +104,7 @@ namespace ns BOOST_FUSION_ADAPT_STRUCT( ns::bar, foo_.x, // test that adapted members can actually be expressions - y + (auto , y) ) BOOST_FUSION_ADAPT_STRUCT( @@ -120,7 +120,7 @@ namespace ns ns::point, (int, x) (int, y) - (BOOST_FUSION_ADAPT_AUTO, z) + (auto, z) ) # if !BOOST_WORKAROUND(__GNUC__,<4) @@ -128,17 +128,18 @@ namespace ns ns::point_with_private_attributes, (int, x) (int, y) - (BOOST_FUSION_ADAPT_AUTO, z) + (auto, z) ) # endif struct s { int m; }; - BOOST_FUSION_ADAPT_STRUCT(s, (BOOST_FUSION_ADAPT_AUTO, m)) + BOOST_FUSION_ADAPT_STRUCT(s, (auto, m)) BOOST_FUSION_ADAPT_STRUCT( ns::bar, - (BOOST_FUSION_ADAPT_AUTO, foo_.x) // test that adapted members can actually be expressions - (BOOST_FUSION_ADAPT_AUTO, y) + (auto, foo_.x) // test that adapted members can actually be expressions + (BOOST_FUSION_ADAPT_AUTO, y) // Mixing auto & BOOST_FUSION_ADAPT_AUTO + // to test backward compatibility ) BOOST_FUSION_ADAPT_STRUCT( diff --git a/test/sequence/adapt_struct_named.cpp b/test/sequence/adapt_struct_named.cpp index 63fc3f5f..b9a8f6aa 100644 --- a/test/sequence/adapt_struct_named.cpp +++ b/test/sequence/adapt_struct_named.cpp @@ -61,13 +61,13 @@ namespace ns BOOST_FUSION_ADAPT_STRUCT_NAMED( ns::point, point, (int, x) - (int, y) - (BOOST_FUSION_ADAPT_AUTO, z) + (BOOST_FUSION_ADAPT_AUTO, y) + (auto, z) ) // this creates a fusion view: ns1::s1 struct s { int m; }; - BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (BOOST_FUSION_ADAPT_AUTO, m)) + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (auto, m)) #endif diff --git a/test/sequence/adapt_tpl_adt.cpp b/test/sequence/adapt_tpl_adt.cpp index c454baa5..28af3935 100644 --- a/test/sequence/adapt_tpl_adt.cpp +++ b/test/sequence/adapt_tpl_adt.cpp @@ -75,7 +75,7 @@ namespace ns (ns::point)(X)(Y), (X, X, obj.get_x(), obj.set_x(val)) (Y, Y, obj.get_y(), obj.set_y(val)) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) + (auto, auto, obj.get_z(), obj.set_z(val)) ) #endif diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index 861bab65..b6a6d021 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -45,7 +45,7 @@ namespace ns (X)(Y), (ns::point)(X)(Y), x, - (BOOST_FUSION_ADAPT_AUTO, y) + (auto, y) (int, z) ) @@ -60,12 +60,12 @@ namespace ns (ns::point)(X)(Y), (X, x) (Y, y) - (BOOST_FUSION_ADAPT_AUTO, z) + (auto, z) ) template struct s { M m; }; - BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (BOOST_FUSION_ADAPT_AUTO, m)) + BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (auto, m)) #endif From d1cd7219691300853d88d68291e96c5d29ae6d81 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Thu, 2 Apr 2015 08:41:15 +0200 Subject: [PATCH 08/18] Replace BOOST_FUSION_ADAPT_AUTO with the standard auto keyword. While BOOST_FUSION_ADAPT_AUTO is still supported for backward compatibiltiy, auto as been put because it has a better readability. --- doc/adapted.qbk | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index a370e373..7de5586f 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -227,7 +227,7 @@ __random_access_sequence__. struct_name, (member_type0, member_name0) (member_type1, member_name1) - (BOOST_FUSION_ADAPT_AUTO, member_name2) + (auto, member_name2) ... ) @@ -240,7 +240,7 @@ The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)` pairs declares the type and names of each of the struct members that are part of the sequence. -When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +When member_typeN is omitted or set to auto, the type is infered with Boost.TypeOf. The macro should be used at global scope, and `struct_name` should be the fully @@ -270,8 +270,8 @@ namespace qualified name of the struct to be adapted. // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_STRUCT( demo::employee, - (BOOST_FUSION_ADAPT_AUTO, name) - (BOOST_FUSION_ADAPT_AUTO, age) + (auto, name) + (auto, age) ) [endsect] @@ -298,7 +298,7 @@ __random_access_sequence__. (struct_name) (specialization_param0)(specialization_param1)..., (member_type0, member_name0) (member_type1, member_name1) - (BOOST_FUSION_ADAPT_AUTO, member_name2), + (auto, member_name2), ... ) @@ -316,7 +316,7 @@ The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)` pairs declares the type and names of each of the struct members that are part of the sequence. -When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +When member_typeN is omitted or set to auto, the type is infered with Boost.TypeOf. The macro should be used at global scope, and `struct_name` should be the fully @@ -345,7 +345,7 @@ namespace qualified name of the struct to be adapted. (demo::employee) (Name)(Age), (Name, name) (Age, age) - (BOOST_FUSION_ADAPT_AUTO, employment_timestamp)) + (auto, employment_timestamp)) // Or by infering type completely BOOST_FUSION_ADAPT_TPL_STRUCT( @@ -390,7 +390,7 @@ adapted using the given name. struct_name, adapted_name, (member_type0, member_name0) (member_type1, member_name1) - (BOOST_FUSION_ADAPT_AUTO, member_name2), + (auto, member_name2), ... ) @@ -400,7 +400,7 @@ adapted using the given name. adapted_name, (member_type0, member_name0) (member_type1, member_name1) - (BOOST_FUSION_ADAPT_AUTO, member_name2), + (auto, member_name2), ... ) @@ -422,7 +422,7 @@ The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)` pairs declares the type and names of each of the struct members that are part of the sequence. -When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +When member_typeN is omitted or set to auto, the type is infered with Boost.TypeOf. The macros should be used at global scope, and `struct_name` should be the fully @@ -453,8 +453,8 @@ namespace qualified name of the struct to be converted. // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_STRUCT_NAMED( demo::employee, adapted_employee, - (BOOST_FUSION_ADAPT_AUTO, name), - (BOOST_FUSION_ADAPT_AUTO, age)) + (auto, name), + (auto, age)) [endsect] @@ -481,7 +481,7 @@ The sequence of `([member_typeN,] member_nameN, key_typeN)` tuples declares the type, name and key type of each of the struct members that are part of the sequence. -When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +When member_typeN is omitted or set to auto, the type is infered with Boost.TypeOf. The macro should be used at global scope, and `struct_name` should be the fully @@ -519,8 +519,8 @@ namespace qualified name of the struct to be adapted. // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_ASSOC_STRUCT( demo::employee, - (BOOST_FUSION_ADAPT_AUTO, name, keys::name), - (BOOST_FUSION_ADAPT_AUTO, age, keys::name)) + (auto, name, keys::name), + (auto, age, keys::name)) [endsect] @@ -554,7 +554,7 @@ The sequence of `([member_typeN,] member_nameN, key_typeN)` tuples declares the type, name and key type of each of the struct members that are part of the sequence. -When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +When member_typeN is omitted or set to auto, the type is infered with Boost.TypeOf. The macro should be used at global scope, and `struct_name` should be the fully @@ -641,7 +641,7 @@ The sequence of `(member_typeN, member_nameN, key_typeN)` triples declares the type, name and key type of each of the struct members that are part of the sequence. -When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +When member_typeN is omitted or set to auto, the type is infered with Boost.TypeOf. The macros should be used at global scope, and `struct_name` should be the fully @@ -678,8 +678,8 @@ namespace qualified name of the struct to be converted. // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( demo::employee, adapted_employee, - (BOOST_FUSION_ADAPT_AUTO, name, keys::name) - (BOOST_FUSION_ADAPT_AUTO, age, keys::age)) + (auto, name, keys::name) + (auto, age, keys::age)) [endsect] @@ -713,7 +713,7 @@ instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types that [^get_expr['N]] denotes to, when omitted the type is deduced from [get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for -variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. +variadic macros auto can be used to avoid repeating the type. [^set_expr['N]] is the expression that is invoked to set the ['N]th element of an instance of `type_name`. This expression may access variables named `obj` of type `type_name&`, which represent the corresponding instance of @@ -823,7 +823,7 @@ instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types that [^get_expr['N]] denotes to, when omitted the type is deduced from [get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for -variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. +variadic macros auto can be used to avoid repeating the type. [^set_expr['N]] is the expression that is invoked to set the ['N]th element of an instance of `type_name`. This expression may access variables named `obj` of type `type_name&`, which represent the corresponding instance of @@ -928,7 +928,7 @@ instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types that [^get_expr['N]] denotes to, when omitted the type is deduced from [get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for -variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. +variadic macros auto can be used to avoid repeating the type. [^set_expr['N]] is the expression that is invoked to set the ['N]th element of an instance of `type_name`. This expression may access variables named `obj` of type `type_name&`, which represent the corresponding instance of @@ -1044,7 +1044,7 @@ instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types that [^get_expr['N]] denotes to, when omitted the type is deduced from [get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for -variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. +variadic macros auto can be used to avoid repeating the type. [^set_expr['N]] is the expression that is invoked to set the ['N]th element of an instance of `type_name`. This expression may access variables named `obj` of type `type_name&`, which represent the corresponding instance of From 11cc331f8224a26604d5869c7c25d026fb7665ec Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 7 Apr 2015 18:46:38 +0200 Subject: [PATCH 09/18] Add test with namespaced names, as it could break with the macro concatenation to check for BOOST_MPL_PP_TOKEN_EQUAL_auto equality. --- test/sequence/adapt_struct.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 5e2e7d3f..f806d96c 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -32,13 +32,17 @@ #include #include +namespace namespaced_type { + typedef int integer; +} + namespace ns { struct point { int x; int y; - int z; + namespaced_type::integer z; }; #if !BOOST_WORKAROUND(__GNUC__,<4) @@ -119,8 +123,8 @@ namespace ns BOOST_FUSION_ADAPT_STRUCT( ns::point, (int, x) - (int, y) - (auto, z) + (auto, y) + (namespaced_type::integer, z) ) # if !BOOST_WORKAROUND(__GNUC__,<4) From 3125c15ff4c0e411f5baff4c538ab5282d1bbb9b Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 23 Jun 2015 21:43:09 +0200 Subject: [PATCH 10/18] Fix BOOST_PP_EMPTY replacement with adapt_assoc_struct --- .../struct/detail/adapt_base_assoc_attr_filler.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp index cbd9c011..373ec313 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #if BOOST_PP_VARIADICS @@ -30,7 +31,14 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(...) \ - ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) + BOOST_PP_IF( \ + BOOST_MPL_PP_TOKEN_EQUAL(auto, BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ + ((2, \ + (BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__), \ + BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__)))), \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), \ + (__VA_ARGS__))) \ + ) #else // BOOST_PP_VARIADICS From 44c21e0f10534da3a98f83a63eec86c7a05b62cc Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 24 Jun 2015 00:08:58 +0200 Subject: [PATCH 11/18] Fixes invalid use of hardcoded "obj." prefix for ADAPT_ASSOC_STRUCT_NAMED and btw. fixes test error since removal of BOOST_PP_IS_EMPTY. --- .../fusion/adapted/struct/adapt_assoc_struct.hpp | 2 +- .../adapted/struct/adapt_assoc_struct_named.hpp | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index eab4e1bb..5f30a9a5 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -44,7 +44,7 @@ NAME_SEQ, \ IS_VIEW, \ I, \ - PREFIX, \ + BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_PP_IF(BOOST_PP_LESS( \ diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp index 2f1a9a30..0d97db5c 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp @@ -12,13 +12,6 @@ #include #include -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0(X, Y, Z) \ - (X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1 -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1(X, Y, Z) \ - (X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0_END -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1_END - #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \ WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ \ @@ -27,9 +20,7 @@ \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW( \ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \ - BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 ATTRIBUTES, \ - _END)) + ATTRIBUTES) #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \ From d7d47619b4920aac4d2f0fe28b521ecc292a28f6 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sun, 14 Feb 2016 23:41:22 +0900 Subject: [PATCH 12/18] Tweak PP includes. --- include/boost/fusion/adapted/adt/adapt_adt.hpp | 1 - include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp | 2 +- include/boost/fusion/adapted/adt/detail/adapt_base.hpp | 1 + .../adapted/adt/detail/adapt_base_assoc_attr_filler.hpp | 2 ++ .../fusion/adapted/adt/detail/adapt_base_attr_filler.hpp | 9 ++------- .../boost/fusion/adapted/struct/adapt_assoc_struct.hpp | 3 ++- include/boost/fusion/adapted/struct/adapt_struct.hpp | 3 +-- .../boost/fusion/adapted/struct/adapt_struct_named.hpp | 2 +- .../boost/fusion/adapted/struct/define_assoc_struct.hpp | 1 + include/boost/fusion/adapted/struct/define_struct.hpp | 1 + .../struct/detail/adapt_base_assoc_attr_filler.hpp | 1 + .../adapted/struct/detail/adapt_base_attr_filler.hpp | 6 ++++-- .../boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp | 2 ++ .../boost/fusion/adapted/struct/detail/define_struct.hpp | 2 -- .../fusion/adapted/struct/detail/preprocessor/is_seq.hpp | 2 -- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/boost/fusion/adapted/adt/adapt_adt.hpp b/include/boost/fusion/adapted/adt/adapt_adt.hpp index 7ff6f4ee..2c0abf06 100644 --- a/include/boost/fusion/adapted/adt/adapt_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_adt.hpp @@ -15,7 +15,6 @@ #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 49a8805d..804cfa89 100644 --- a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp @@ -14,7 +14,7 @@ #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 dec17251..18fd34ab 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp index 1093577e..bc733582 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp @@ -15,8 +15,10 @@ #include +#include #include #include +#include #if BOOST_PP_VARIADICS diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp index 91cc8464..13f64686 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp @@ -11,7 +11,6 @@ #include #include - #include #include @@ -19,17 +18,13 @@ #include #include #include -#include #include #include -#include +#include #include -#include -#include +#include #include -#include - #define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE) \ BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE) diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index 5f30a9a5..845c4e00 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -13,7 +13,8 @@ #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 2744f5b2..5058885e 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -86,7 +85,7 @@ BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER( \ BOOST_PP_SEQ_TAIL(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \ BOOST_FUSION_ADAPT_STRUCT_C) - + #else // BOOST_PP_VARIADICS # define BOOST_FUSION_ADAPT_TPL_STRUCT( \ diff --git a/include/boost/fusion/adapted/struct/adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/adapt_struct_named.hpp index 791fb5b0..0c61b42a 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct_named.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct_named.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #ifdef BOOST_PP_VARIADICS diff --git a/include/boost/fusion/adapted/struct/define_assoc_struct.hpp b/include/boost/fusion/adapted/struct/define_assoc_struct.hpp index f4a3679d..faea077f 100644 --- a/include/boost/fusion/adapted/struct/define_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/define_assoc_struct.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ ((X, Y, Z)) BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1 diff --git a/include/boost/fusion/adapted/struct/define_struct.hpp b/include/boost/fusion/adapted/struct/define_struct.hpp index 29785436..c9ae4229 100644 --- a/include/boost/fusion/adapted/struct/define_struct.hpp +++ b/include/boost/fusion/adapted/struct/define_struct.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #define BOOST_FUSION_DEFINE_TPL_STRUCT( \ TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp index 373ec313..fda14e73 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp @@ -15,6 +15,7 @@ #include +#include #include #include #include diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp index b4abe113..78af0886 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp @@ -15,11 +15,13 @@ #include -#include +#include +#include #include -#include #include #include +#include +#include #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp b/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp index 2b54a2c0..8430262f 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp @@ -8,6 +8,8 @@ #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP +#include + #define BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ) \ BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) diff --git a/include/boost/fusion/adapted/struct/detail/define_struct.hpp b/include/boost/fusion/adapted/struct/detail/define_struct.hpp index ce3737ea..26bb11f5 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct.hpp @@ -16,13 +16,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include diff --git a/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp b/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp index 95f11050..00371ca5 100644 --- a/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp +++ b/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp @@ -13,8 +13,6 @@ #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP -#include -#include #include #include #include From c9c2c3bad6386fcdbea67ecde0aabe924d566b46 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sun, 14 Feb 2016 23:53:38 +0900 Subject: [PATCH 13/18] Optimize macros. --- include/boost/fusion/adapted/adt/adapt_adt.hpp | 6 ++---- include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp | 6 ++---- include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp | 2 +- include/boost/fusion/adapted/struct/adapt_struct.hpp | 6 ++---- include/boost/fusion/adapted/struct/detail/adapt_base.hpp | 6 +++--- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/include/boost/fusion/adapted/adt/adapt_adt.hpp b/include/boost/fusion/adapted/adt/adapt_adt.hpp index 2c0abf06..bc5e7999 100644 --- a/include/boost/fusion/adapted/adt/adapt_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_adt.hpp @@ -47,10 +47,8 @@ BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ - BOOST_PP_IF( \ - BOOST_PP_LESS( \ - BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4) \ - , 1, 0)) + BOOST_PP_LESS( \ + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4)) \ #define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ diff --git a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp index 804cfa89..7f8237a9 100644 --- a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp @@ -49,10 +49,8 @@ BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ - BOOST_PP_IF( \ - BOOST_PP_LESS( \ - BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5) \ - , 1, 0)) \ + BOOST_PP_LESS( \ + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5)) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(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 845c4e00..5f493559 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -48,7 +48,7 @@ BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ - BOOST_PP_IF(BOOST_PP_LESS( \ + BOOST_PP_IIF(BOOST_PP_LESS( \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3), 1, 0)) \ \ template< \ diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 5058885e..0a4d4aac 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -47,10 +47,8 @@ BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ - BOOST_PP_IF( \ - BOOST_PP_LESS( \ - BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2) \ - , 1, 0)) + BOOST_PP_LESS( \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2)) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 8ec467ae..27b84755 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -202,7 +203,7 @@ { \ return seq.PREFIX() \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ - BOOST_PP_IF(DEDUCE_TYPE, 0, 1), ATTRIBUTE); \ + BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE); \ } \ }; \ }; \ @@ -223,8 +224,7 @@ { \ return BOOST_PP_STRINGIZE( \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ - BOOST_PP_IF(DEDUCE_TYPE, 0, 1), \ - ATTRIBUTE)); \ + BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE)); \ } \ }; From 9b43ac8ee002783da5e91d986649429213615872 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 16 Feb 2016 00:40:27 +0900 Subject: [PATCH 14/18] More optimization. --- include/boost/fusion/adapted/adt/adapt_adt.hpp | 2 +- .../boost/fusion/adapted/adt/adapt_assoc_adt.hpp | 2 +- .../adt/detail/adapt_base_assoc_attr_filler.hpp | 2 +- .../adt/detail/adapt_base_attr_filler.hpp | 6 +++--- .../fusion/adapted/struct/adapt_assoc_struct.hpp | 4 ++-- .../boost/fusion/adapted/struct/adapt_struct.hpp | 4 ++-- .../fusion/adapted/struct/detail/adapt_base.hpp | 2 +- .../detail/adapt_base_assoc_attr_filler.hpp | 6 +++--- .../struct/detail/adapt_base_attr_filler.hpp | 16 ++++++++-------- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/boost/fusion/adapted/adt/adapt_adt.hpp b/include/boost/fusion/adapted/adt/adapt_adt.hpp index bc5e7999..2ebc76c3 100644 --- a/include/boost/fusion/adapted/adt/adapt_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_adt.hpp @@ -44,7 +44,7 @@ TEMPLATE_PARAMS_SEQ, \ NAME_SEQ, \ I, \ - BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ + BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_PP_LESS( \ diff --git a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp index 7f8237a9..bd451a32 100644 --- a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp @@ -46,7 +46,7 @@ TEMPLATE_PARAMS_SEQ, \ NAME_SEQ, \ I, \ - BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ + BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_PP_LESS( \ diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp index bc733582..ff49ec1f 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp @@ -44,7 +44,7 @@ BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 #define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \ - BOOST_PP_IF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \ + BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \ ((3, (C,D,E))), \ ((5, (A,B,C,D,E))) \ ) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp index 13f64686..90a12b01 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -46,7 +46,7 @@ # define BOOST_FUSION_ADAPT_ADT_FILLER_1_END # define BOOST_FUSION_ADAPT_ADT_FILLER(...) \ - BOOST_PP_IF( \ + BOOST_PP_IIF( \ BOOST_PP_OR( \ BOOST_MPL_PP_TOKEN_EQUAL(auto, \ BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ @@ -81,7 +81,7 @@ # define BOOST_FUSION_ADAPT_ADT_FILLER_1_END # define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A, B, C, D) \ - BOOST_PP_IF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \ + BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \ ((2, (C,D))), \ ((4, (A,B,C,D))) \ ) diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index 5f493559..44b14db1 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -45,7 +45,7 @@ NAME_SEQ, \ IS_VIEW, \ I, \ - BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ + BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_PP_IIF(BOOST_PP_LESS( \ diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 0a4d4aac..66710b47 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -44,7 +44,7 @@ NAME_SEQ, \ IS_VIEW, \ I, \ - BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ + BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_PP_LESS( \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 27b84755..39f15206 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -274,7 +274,7 @@ namespace boost struct struct_is_view< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ > \ - : mpl::BOOST_PP_IF(IS_VIEW,true_,false_) \ + : mpl::BOOST_PP_IIF(IS_VIEW,true_,false_) \ {}; \ } \ } \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp index fda14e73..972abd9b 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -32,7 +32,7 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(...) \ - BOOST_PP_IF( \ + BOOST_PP_IIF( \ BOOST_MPL_PP_TOKEN_EQUAL(auto, BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ ((2, \ (BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__), \ @@ -53,7 +53,7 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \ - BOOST_PP_IF(BOOST_MPL_PP_TOKEN_EQUAL(auto, X), \ + BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, X), \ ((2, (Y,Z))), \ ((3, (X,Y,Z))) \ ) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp index 78af0886..3755bc36 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp @@ -16,7 +16,9 @@ #include #include -#include +#include +#include +#include #include #include #include @@ -36,7 +38,7 @@ #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END #define BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X, Y) \ - BOOST_PP_IF(BOOST_MPL_PP_TOKEN_EQUAL(auto, BOOST_PP_EXPAND(X)), \ + BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, BOOST_PP_EXPAND(X)), \ ((1, (Y))), \ ((2, (X,Y))) \ ) @@ -51,12 +53,10 @@ #if BOOST_PP_VARIADICS # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, unused, elem) \ - BOOST_PP_IF(BOOST_FUSION_PP_IS_SEQ(elem), \ - BOOST_PP_CAT( BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END), \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(elem), \ - BOOST_PP_EMPTY(), \ - BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(auto,elem))\ - ) + BOOST_PP_IIF(BOOST_FUSION_PP_IS_SEQ(elem), \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END), \ + BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(BOOST_PP_IS_EMPTY(elem)), \ + BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(auto, elem))) # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(VA_ARGS_SEQ) \ BOOST_PP_SEQ_PUSH_FRONT( \ From 4173b4b97beae2fe9c72c6212bec1acfe64ac013 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 16 Feb 2016 01:02:58 +0900 Subject: [PATCH 15/18] Suppress conversion warnings on MSVC. --- test/algorithm/replace_if.cpp | 2 +- test/sequence/adapt_adt.cpp | 4 ++-- test/sequence/adapt_adt_named.cpp | 4 ++-- test/sequence/adapt_assoc_adt.cpp | 4 ++-- test/sequence/adapt_assoc_adt_named.cpp | 4 ++-- test/sequence/adapt_assoc_struct.cpp | 4 ++-- test/sequence/adapt_assoc_struct_named.cpp | 4 ++-- test/sequence/adapt_assoc_tpl_adt.cpp | 4 ++-- test/sequence/adapt_assoc_tpl_struct.cpp | 12 ++++++------ test/sequence/adapt_struct.cpp | 6 +++--- test/sequence/adapt_struct_named.cpp | 4 ++-- test/sequence/adapt_tpl_adt.cpp | 4 ++-- test/sequence/adapt_tpl_struct.cpp | 4 ++-- test/sequence/define_assoc_struct.cpp | 4 ++-- test/sequence/define_assoc_tpl_struct.cpp | 4 ++-- test/sequence/define_struct.cpp | 4 ++-- test/sequence/define_struct_inline.cpp | 4 ++-- test/sequence/define_tpl_struct.cpp | 4 ++-- test/sequence/define_tpl_struct_inline.cpp | 4 ++-- test/sequence/vector_n.cpp | 2 +- 20 files changed, 43 insertions(+), 43 deletions(-) diff --git a/test/algorithm/replace_if.cpp b/test/algorithm/replace_if.cpp index 7327632f..bad5905e 100644 --- a/test/algorithm/replace_if.cpp +++ b/test/algorithm/replace_if.cpp @@ -38,7 +38,7 @@ main() { char const* s = "Ruby"; typedef vector vector_type; - vector_type t1(1, 2, 3.3, 4, s, 5.5); + vector_type t1(1, 2, 3.3, 4, s, 5.5f); { std::cout << replace_if(t1, gt3(), -456) << std::endl; diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index bf5d4ca0..528c72c7 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -185,9 +185,9 @@ main() } { - fusion::vector v1(4, 2, 2); + fusion::vector v1(4, 2.f, 2); ns::point v2(5, 3, 3); - fusion::vector v3(5, 4, 4); + fusion::vector v3(5, 4., 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index f7e115aa..7cadb0bc 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -115,11 +115,11 @@ main() } { - fusion::vector v1(4, 2, 2); + fusion::vector v1(4, 2.f, 2); ns::point basep(5, 3, 3); adapted::point v2(basep); - fusion::vector v3(5, 4, 4); + fusion::vector v3(5, 4., 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index fca3941d..97920621 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -105,9 +105,9 @@ main() } { - boost::fusion::vector v1(4, 2, 2); + boost::fusion::vector v1(4, 2.f, 2); ns::point v2(5, 3, 3); - boost::fusion::vector v3(5, 4, 4); + boost::fusion::vector v3(5, 4., 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/adapt_assoc_adt_named.cpp b/test/sequence/adapt_assoc_adt_named.cpp index d685528d..5a88227f 100644 --- a/test/sequence/adapt_assoc_adt_named.cpp +++ b/test/sequence/adapt_assoc_adt_named.cpp @@ -86,10 +86,10 @@ main() } { - boost::fusion::vector v1(4, 2); + boost::fusion::vector v1(4, 2.f); ns::point basev2(5, 3); adapted::point v2(basev2); - boost::fusion::vector v3(5, 4); + boost::fusion::vector v3(5, 4.); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index 6bb4a8ee..11362580 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -107,9 +107,9 @@ main() } { - fusion::vector v1(4, 2, 2); + fusion::vector v1(4, 2.f, 2); ns::point v2 = {5, 3, 3}; - fusion::vector v3(5, 4, 4); + fusion::vector v3(5, 4., 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/adapt_assoc_struct_named.cpp b/test/sequence/adapt_assoc_struct_named.cpp index fd7fdc50..eed7ffa7 100644 --- a/test/sequence/adapt_assoc_struct_named.cpp +++ b/test/sequence/adapt_assoc_struct_named.cpp @@ -72,11 +72,11 @@ main() } { - vector v1(4, 2); + vector v1(4, 2.f); ns::point basev2 = {5, 3}; adapted::point v2(basev2); - vector v3(5, 4); + vector v3(5, 4.); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index e0b89dca..c10d8754 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -119,9 +119,9 @@ main() } { - boost::fusion::vector v1(4, 2, 2); + boost::fusion::vector v1(4, 2.f, 2); point v2(5, 3, 3); - boost::fusion::vector v3(5, 4, 4); + boost::fusion::vector v3(5, 4., 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index a949dad0..02ef5484 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -117,9 +117,9 @@ main() } { - vector v1(4, 2, 2); - point v2 = {5, 3, 3}; - vector v3(5, 4, 4.13f); + vector v1(4, 2.f, 2); + point v2 = {5, 3, 3.f}; + vector v3(5, 4., 4.13f); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -132,14 +132,14 @@ main() { // conversion from point to vector - point p = {5, 3, 3}; + point p = {5, 3, 3.f}; vector v(p); v = p; } { // conversion from point to list - point p = {5, 3, 3}; + point p = {5, 3, 3.f}; list l(p); l = p; } @@ -155,7 +155,7 @@ main() BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, float>)); - point p = {5, 3, 9}; + point p = {5, 3, 9.f}; BOOST_TEST(at_key(p) == 5); BOOST_TEST(at_key(p) == 3); diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index e4c8f6ee..9c7e26d7 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -186,9 +186,9 @@ main() } { - vector v1(4, 2, 2); + vector v1(4, 2.f, 2); point v2 = {5, 3, 3}; - vector v3(5, 4, 4); + vector v3(5, 4., 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -243,7 +243,7 @@ main() #endif { - fusion::vector v1(4, 2); + fusion::vector v1(4, 2.f); ns::bar v2 = {{5}, 3}; BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); diff --git a/test/sequence/adapt_struct_named.cpp b/test/sequence/adapt_struct_named.cpp index 63fc3f5f..29b27373 100644 --- a/test/sequence/adapt_struct_named.cpp +++ b/test/sequence/adapt_struct_named.cpp @@ -109,11 +109,11 @@ main() } { - fusion::vector v1(4, 2, 2); + fusion::vector v1(4, 2.f, 2); ns::point p = {5, 3, 3}; adapted::point v2(p); - fusion::vector v3(5, 4, 4); + fusion::vector v3(5, 4., 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/adapt_tpl_adt.cpp b/test/sequence/adapt_tpl_adt.cpp index c454baa5..b544ad17 100644 --- a/test/sequence/adapt_tpl_adt.cpp +++ b/test/sequence/adapt_tpl_adt.cpp @@ -128,9 +128,9 @@ main() } { - boost::fusion::vector v1(4, 2, 2); + boost::fusion::vector v1(4, 2.f, 2); point v2(5, 3, 3); - boost::fusion::vector v3(5, 4, 4); + boost::fusion::vector v3(5, 4., 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index 861bab65..53937dca 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -117,9 +117,9 @@ main() } { - vector v1(4, 2, 2); + vector v1(4, 2.f, 2); point v2 = {5, 3, 3}; - vector v3(5, 4, 4); + vector v3(5, 4., 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/define_assoc_struct.cpp b/test/sequence/define_assoc_struct.cpp index ed8dfbe0..c8caac1c 100644 --- a/test/sequence/define_assoc_struct.cpp +++ b/test/sequence/define_assoc_struct.cpp @@ -59,9 +59,9 @@ main() } { - vector v1(4, 2); + vector v1(4, 2.f); ns::point v2(5, 3); - vector v3(5, 4); + vector v3(5, 4.); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/define_assoc_tpl_struct.cpp b/test/sequence/define_assoc_tpl_struct.cpp index 6d0b5bdb..f7986395 100644 --- a/test/sequence/define_assoc_tpl_struct.cpp +++ b/test/sequence/define_assoc_tpl_struct.cpp @@ -63,9 +63,9 @@ main() } { - vector v1(4, 2); + vector v1(4, 2.f); point v2(5, 3); - vector v3(5, 4); + vector v3(5, 4.0); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/define_struct.cpp b/test/sequence/define_struct.cpp index d91dda95..f4862548 100644 --- a/test/sequence/define_struct.cpp +++ b/test/sequence/define_struct.cpp @@ -71,9 +71,9 @@ main() } { - vector v1(4, 2); + vector v1(4, 2.f); ns::point v2(5, 3); - vector v3(5, 4); + vector v3(5, 4.0); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/define_struct_inline.cpp b/test/sequence/define_struct_inline.cpp index d34a142b..3a902372 100644 --- a/test/sequence/define_struct_inline.cpp +++ b/test/sequence/define_struct_inline.cpp @@ -85,9 +85,9 @@ void run_test() } { - vector v1(4, 2); + vector v1(4, 2.0f); Point v2(5, 3); - vector v3(5, 4); + vector v3(5, 4.); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/define_tpl_struct.cpp b/test/sequence/define_tpl_struct.cpp index 9896493c..586e21cf 100644 --- a/test/sequence/define_tpl_struct.cpp +++ b/test/sequence/define_tpl_struct.cpp @@ -59,9 +59,9 @@ main() } { - vector v1(4, 2); + vector v1(4, 2.f); point v2(5, 3); - vector v3(5, 4); + vector v3(5, 4.); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/define_tpl_struct_inline.cpp b/test/sequence/define_tpl_struct_inline.cpp index fad064f7..18fdb0d1 100644 --- a/test/sequence/define_tpl_struct_inline.cpp +++ b/test/sequence/define_tpl_struct_inline.cpp @@ -80,9 +80,9 @@ void run_test() } { - vector v1(4, 2); + vector v1(4, 2.f); Point v2(5, 3); - vector v3(5, 4); + vector v3(5, 4.); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); diff --git a/test/sequence/vector_n.cpp b/test/sequence/vector_n.cpp index 05c07ce4..2109bd5c 100644 --- a/test/sequence/vector_n.cpp +++ b/test/sequence/vector_n.cpp @@ -136,7 +136,7 @@ main() { typedef vector7 type; - type vec(false, 'x', 3, 4, 5, 6.0, 7.0); + type vec(false, 'x', 3, 4, 5, 6.f, 7.0); BOOST_TEST(at_c<0>(vec) == false); BOOST_TEST(at_c<1>(vec) == 'x'); From 99ad77b92fbb8649656ba034b187b42771d29ce7 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 16 Feb 2016 16:52:27 +0900 Subject: [PATCH 16/18] Fix typos. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 36 +++--- .../adapted/struct/detail/adapt_base.hpp | 20 ++-- .../adapted/struct/detail/define_struct.hpp | 112 +++++++++--------- 3 files changed, 84 insertions(+), 84 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 18fd34ab..912d0160 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -37,18 +37,18 @@ boost::remove_const::type>::type #define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ - ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \ BOOST_PP_IF(DEDUCE_TYPE, 0, 2), ATTRIBUTE) #define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \ - ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \ BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE) #ifdef BOOST_MSVC # define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \ - ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ @@ -58,25 +58,25 @@ typedef \ BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ - ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ + ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, 1)) type; \ }; #else # define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \ - ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ typedef BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ - ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ + ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, 1)) type; \ }; #endif #define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ BOOST_FUSION_DEDUCED_ATTR_TYPE( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ typedef \ BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ @@ -93,15 +93,15 @@ >::type const_type; #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) const_type; + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 0, ATTRIBUTE) type; \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 1, ATTRIBUTE) const_type; #define BOOST_FUSION_ADAPT_ADT_C_BASE( \ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX, \ - ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ + ATTRIBUTE,ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -117,7 +117,7 @@ BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE)( \ NAME_SEQ, \ ATTRIBUTE, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ PREFIX, \ TEMPLATE_PARAMS_SEQ) \ \ @@ -129,7 +129,7 @@ Val const& val) \ { \ PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \ - ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ + ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE); \ } \ \ BOOST_FUSION_GPU_ENABLED \ @@ -138,7 +138,7 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ { \ return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ - ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ + ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE); \ } \ \ BOOST_FUSION_GPU_ENABLED \ @@ -147,7 +147,7 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ { \ return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ - ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ + ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE); \ } \ }; \ \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 39f15206..84b9302c 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -65,7 +65,7 @@ #ifdef BOOST_MSVC # define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ @@ -74,7 +74,7 @@ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ typedef \ BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ - BOOST_TYPEOF( PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + BOOST_TYPEOF( PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \ 0, ATTRIBUTE)) \ type; \ }; \ @@ -85,12 +85,12 @@ #else # define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ typedef BOOST_TYPEOF( \ - PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) \ + PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 0, ATTRIBUTE)) \ type; \ }; \ \ @@ -101,9 +101,9 @@ #endif #define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ typedef \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) attribute_type; + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 0, ATTRIBUTE) attribute_type; #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS @@ -160,7 +160,7 @@ #define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, \ - I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, \ + I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPLE_SIZE, \ DEDUCE_TYPE) \ \ template< \ @@ -175,7 +175,7 @@ BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE)( \ NAME_SEQ, \ ATTRIBUTE, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ PREFIX, \ TEMPLATE_PARAMS_SEQ) \ \ @@ -202,7 +202,7 @@ call(Seq& seq) \ { \ return seq.PREFIX() \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \ BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE); \ } \ }; \ @@ -223,7 +223,7 @@ call() \ { \ return BOOST_PP_STRINGIZE( \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \ BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE)); \ } \ }; diff --git a/include/boost/fusion/adapted/struct/detail/define_struct.hpp b/include/boost/fusion/adapted/struct/detail/define_struct.hpp index 26bb11f5..ab483f02 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct.hpp @@ -40,14 +40,14 @@ #define BOOST_FUSION_DEFINE_STRUCT_FILLER_1_END #define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \ - R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \ \ BOOST_PP_COMMA_IF(I) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \ - other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)) + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)( \ + other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)) #define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \ - R, ATTRIBUTE_TUPEL_SIZE, I_, ATTRIBUTE) \ + R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \ \ BOOST_PP_EXPR_IF( \ I_, \ @@ -60,11 +60,11 @@ boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_))); \ ) \ \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)= \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)= \ boost::fusion::deref(BOOST_PP_CAT(i,I_)); #define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP( \ - ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ template \ BOOST_FUSION_GPU_ENABLED \ @@ -79,51 +79,51 @@ BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ ATTRIBUTES_SEQ) \ \ return *this; \ } -#define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPEL_SIZE, ATTRIBUTE) \ +#define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPLE_SIZE, ATTRIBUTE) \ \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,0,ATTRIBUTE) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE); + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,0,ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE); #define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I( \ - R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \ \ BOOST_PP_COMMA_IF(I) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)( \ boost::fusion::deref(boost::fusion::advance_c(boost::fusion::begin( \ seq)))) #define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER( \ - ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ , typename boost::disable_if< \ boost::is_convertible< \ Seq const& \ , BOOST_PP_TUPLE_ELEM( \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ 0, \ BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ > \ >::type* =0 #define BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I( \ - R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \ \ BOOST_PP_COMMA_IF(I) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)() + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)() #define BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \ - NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_PP_SEQ_FOR_EACH_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_ATTR_I, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ ATTRIBUTES_SEQ) \ \ BOOST_FUSION_GPU_ENABLED \ @@ -131,7 +131,7 @@ : BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ ATTRIBUTES_SEQ) \ {} \ \ @@ -140,7 +140,7 @@ : BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ ATTRIBUTES_SEQ) \ {} \ \ @@ -151,53 +151,53 @@ BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_PP_TUPLE_EAT(2), \ BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER)( \ - ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ ) \ : BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ ATTRIBUTES_SEQ) \ {} \ \ - BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) + BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) #define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \ - NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_GPU_ENABLED \ explicit \ NAME(boost::call_traits< \ BOOST_PP_TUPLE_ELEM( \ - ATTRIBUTE_TUPEL_SIZE,0,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ + ATTRIBUTE_TUPLE_SIZE,0,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ >::param_type arg) \ : BOOST_PP_TUPLE_ELEM( \ - ATTRIBUTE_TUPEL_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \ + ATTRIBUTE_TUPLE_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \ {} #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \ - TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_GPU_ENABLED \ explicit \ NAME(typename boost::call_traits< \ typename boost::fusion::detail::get_first_arg< \ BOOST_PP_TUPLE_ELEM( \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ 0, \ BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ , BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \ >::type \ >::param_type arg) \ : BOOST_PP_TUPLE_ELEM( \ - ATTRIBUTE_TUPEL_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \ + ATTRIBUTE_TUPLE_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \ {} #define BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I( \ - R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \ \ BOOST_PP_COMMA_IF(I) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)(BOOST_PP_CAT(_,I)) + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)(BOOST_PP_CAT(_,I)) #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I(R, DATA, I, ATTRIBUTE) \ \ @@ -213,14 +213,14 @@ >::param_type BOOST_PP_CAT(_,I) #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \ - TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_GPU_ENABLED \ NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \ ( \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \ BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \ ), \ @@ -228,61 +228,61 @@ : BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ ATTRIBUTES_SEQ) \ {} #define BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I( \ - R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \ \ BOOST_PP_COMMA_IF(I) \ boost::call_traits< \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,0,ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,0,ATTRIBUTE) \ >::param_type BOOST_PP_CAT(_,I) #define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \ - NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_GPU_ENABLED \ NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ ATTRIBUTES_SEQ)) \ : BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \ - ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTE_TUPLE_SIZE, \ ATTRIBUTES_SEQ) \ {} #define BOOST_FUSION_DEFINE_STRUCT_CTOR( \ - NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_FUSION_DEFINE_STRUCT_CTOR_N, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_1)( \ - NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \ - TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N, \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1)( \ - TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) #define BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL( \ - NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \ - NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPEL_SIZE) \ + NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_DEFINE_STRUCT_CTOR( \ - NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPEL_SIZE) + NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE) #define BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \ - NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ template \ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ @@ -298,7 +298,7 @@ } #define BOOST_FUSION_DEFINE_STRUCT_IMPL( \ - NAMESPACE_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + NAMESPACE_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \ \ @@ -309,35 +309,35 @@ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL, \ BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL)( \ - NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ }; \ \ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) #define BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL( \ - TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \ - NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPEL_SIZE) \ + NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \ TEMPLATE_PARAMS_SEQ, \ NAME, \ BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), \ - ATTRIBUTE_TUPEL_SIZE) + ATTRIBUTE_TUPLE_SIZE) #define BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL( \ - TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \ - NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) #define BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \ TEMPLATE_PARAMS_SEQ, \ NAMESPACE_SEQ, \ NAME, \ ATTRIBUTES_SEQ, \ - ATTRIBUTE_TUPEL_SIZE) \ + ATTRIBUTE_TUPLE_SIZE) \ \ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \ \ @@ -352,7 +352,7 @@ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL, \ BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL)( \ - TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE)\ + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)\ }; \ \ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) From 4ebc02876907685bbc5c5f2b7e402179c84c785d Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 16 Feb 2016 19:32:57 +0900 Subject: [PATCH 17/18] Optimize. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 23 ++++++++++++------- .../detail/adapt_base_assoc_attr_filler.hpp | 6 ++--- .../adt/detail/adapt_base_attr_filler.hpp | 5 ++-- .../adapted/struct/adapt_assoc_struct.hpp | 4 ++-- .../detail/adapt_base_assoc_attr_filler.hpp | 4 ++-- .../struct/detail/define_struct_inline.hpp | 14 +++-------- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 912d0160..0ef6fcd9 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -56,7 +57,8 @@ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ typedef \ - BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ + BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \ + typename) \ BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, 1)) type; \ }; @@ -79,16 +81,20 @@ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ typedef \ - BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ + BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \ + typename) \ boost::remove_const< \ - BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ + BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \ + typename) \ deduced_attr_type::type \ >::type type; \ \ typedef \ - BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ + BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \ + typename) \ boost::add_const< \ - BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ + BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \ + typename) \ deduced_attr_type::type \ >::type const_type; @@ -161,7 +167,7 @@ > \ { \ typedef \ - BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ + BOOST_PP_EXPR_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename) \ access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ @@ -202,7 +208,7 @@ > \ { \ typedef \ - BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ + BOOST_PP_EXPR_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename) \ access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ @@ -253,7 +259,8 @@ , I \ > \ { \ - typedef BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ + typedef BOOST_PP_EXPR_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), \ + typename) \ adt_attribute_proxy< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp index ff49ec1f..daa73063 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp @@ -16,9 +16,9 @@ #include #include -#include +#include #include -#include +#include #if BOOST_PP_VARIADICS @@ -58,7 +58,7 @@ #define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \ BOOST_PP_TUPLE_ELEM( \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ - BOOST_PP_SUB(BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \ + BOOST_PP_DEC(BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE)), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE)) #endif diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp index 90a12b01..dc9e2c3b 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp @@ -15,7 +15,7 @@ #include -#include +#include #include #include #include @@ -45,6 +45,7 @@ # define BOOST_FUSION_ADAPT_ADT_FILLER_0_END # define BOOST_FUSION_ADAPT_ADT_FILLER_1_END +// MSVC don't compile when using BOOST_PP_BITOR instead of BOOST_PP_OR. # define BOOST_FUSION_ADAPT_ADT_FILLER(...) \ BOOST_PP_IIF( \ BOOST_PP_OR( \ @@ -64,7 +65,7 @@ # define BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(...) \ BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REST_N( \ - BOOST_PP_SUB(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 1), \ + BOOST_PP_DEC(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__)), \ BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))) #else // BOOST_PP_VARIADICS diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index 44b14db1..c8659fdf 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -48,8 +48,8 @@ BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ - BOOST_PP_IIF(BOOST_PP_LESS( \ - BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3), 1, 0)) \ + BOOST_PP_LESS( \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3)) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp index 972abd9b..8c480111 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -67,7 +67,7 @@ #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \ BOOST_PP_TUPLE_ELEM( \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ - BOOST_PP_SUB(BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \ + BOOST_PP_DEC(BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE)), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE)) #endif diff --git a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp index a037ffe5..1db1a2ef 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -62,7 +62,6 @@ ~, \ ATTRIBUTES_SEQ) \ -#define BOOST_FUSION_IGNORE_1(ARG1) #define BOOST_FUSION_IGNORE_2(ARG1, ARG2) #define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \ @@ -425,17 +424,10 @@ #define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \ NAME, ATTRIBUTES_SEQ, ATTRIBUTES_SEQ_SIZE) \ \ - /* Note: second BOOST_PP_IF is necessary to avoid MSVC warning when */ \ - /* calling BOOST_FUSION_IGNORE_1 with no arguments. */ \ NAME() \ - BOOST_PP_IF( \ - ATTRIBUTES_SEQ_SIZE, \ + BOOST_PP_IF(ATTRIBUTES_SEQ_SIZE, \ BOOST_FUSION_MAKE_DEFAULT_INIT_LIST, \ - BOOST_FUSION_IGNORE_1) \ - (BOOST_PP_IF( \ - ATTRIBUTES_SEQ_SIZE, \ - ATTRIBUTES_SEQ, \ - 0)) \ + BOOST_PP_EMPTY)(ATTRIBUTES_SEQ) \ { \ } \ \ From 5ed26ec9328b74ec989a88d131a6d481c079b7f8 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 16 Feb 2016 23:55:59 +0900 Subject: [PATCH 18/18] Drop Byte-order-Marker. --- include/boost/fusion/support/detail/enabler.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/fusion/support/detail/enabler.hpp b/include/boost/fusion/support/detail/enabler.hpp index 9dd8b4bb..ea263a41 100644 --- a/include/boost/fusion/support/detail/enabler.hpp +++ b/include/boost/fusion/support/detail/enabler.hpp @@ -1,4 +1,4 @@ -/*============================================================================= +/*============================================================================= Copyright (c) 2015 Kohei Takahashi Distributed under the Boost Software License, Version 1.0. (See accompanying