From e67765747d2f8401ed51f7eb6e373fa00ba8d356 Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Thu, 25 Feb 2010 20:10:37 +0000 Subject: [PATCH] better adapt structs/classes implementation [SVN r59913] --- .../adapted/class/adapt_assoc_class.hpp | 37 ++++--- .../fusion/adapted/class/adapt_class.hpp | 32 ++++--- .../adapted/class/adapt_class_named.hpp | 2 + .../adapted/class/detail/adapt_base.hpp | 96 ++++++++++++------- .../fusion/adapted/class/detail/at_impl.hpp | 55 ----------- .../adapted/class/detail/begin_impl.hpp | 65 ------------- .../adapted/class/detail/category_of_impl.hpp | 32 ------- .../adapted/class/detail/deref_data_impl.hpp | 22 ----- .../adapted/class/detail/deref_impl.hpp | 55 ----------- .../fusion/adapted/class/detail/end_impl.hpp | 66 ------------- .../fusion/adapted/class/detail/extension.hpp | 26 +++-- .../adapted/class/detail/is_sequence_impl.hpp | 29 ------ .../adapted/class/detail/is_view_impl.hpp | 29 ------ .../adapted/class/detail/key_of_impl.hpp | 24 ----- .../fusion/adapted/class/detail/size_impl.hpp | 29 ------ .../adapted/class/detail/value_at_impl.hpp | 29 ------ .../class/detail/value_of_data_impl.hpp | 24 ----- .../adapted/class/detail/value_of_impl.hpp | 29 ------ .../adapted/struct/adapt_assoc_struct.hpp | 4 + .../fusion/adapted/struct/adapt_struct.hpp | 4 + .../adapted/struct/adapt_struct_named.hpp | 2 + .../adapted/struct/detail/adapt_base.hpp | 70 ++++++++++---- .../fusion/adapted/struct/detail/at_impl.hpp | 36 ++----- .../adapted/struct/detail/begin_impl.hpp | 6 +- .../struct/detail/category_of_impl.hpp | 4 +- .../adapted/struct/detail/deref_data_impl.hpp | 8 +- .../adapted/struct/detail/deref_impl.hpp | 45 +++------ .../fusion/adapted/struct/detail/end_impl.hpp | 7 +- .../adapted/struct/detail/extension.hpp | 8 +- .../struct/detail/is_sequence_impl.hpp | 5 +- .../adapted/struct/detail/is_view_impl.hpp | 5 +- .../adapted/struct/detail/key_of_impl.hpp | 21 ++-- .../adapted/struct/detail/proxy_type.hpp | 5 +- .../adapted/struct/detail/size_impl.hpp | 7 +- .../adapted/struct/detail/value_at_impl.hpp | 7 +- .../struct/detail/value_of_data_impl.hpp | 8 +- .../adapted/struct/detail/value_of_impl.hpp | 24 ++--- .../sequence/comparison/detail/greater.hpp | 5 +- .../sequence/comparison/detail/less.hpp | 5 +- 39 files changed, 266 insertions(+), 701 deletions(-) delete mode 100644 include/boost/fusion/adapted/class/detail/at_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/deref_data_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/end_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/key_of_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/size_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/value_of_data_impl.hpp delete mode 100644 include/boost/fusion/adapted/class/detail/value_of_impl.hpp diff --git a/include/boost/fusion/adapted/class/adapt_assoc_class.hpp b/include/boost/fusion/adapted/class/adapt_assoc_class.hpp index 676f0fb0..26eb3ae6 100644 --- a/include/boost/fusion/adapted/class/adapt_assoc_class.hpp +++ b/include/boost/fusion/adapted/class/adapt_assoc_class.hpp @@ -1,4 +1,6 @@ /*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2007 Dan Marsden Copyright (c) 2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -11,22 +13,27 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0(A, B, C, D, E)\ ((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1 @@ -54,7 +61,7 @@ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (1)TEMPLATE_PARAMS_SEQ, \ (1)NAME_SEQ, \ - assoc_class_tag, \ + assoc_struct_tag, \ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \ BOOST_FUSION_ADAPT_ASSOC_CLASS_C) @@ -62,7 +69,7 @@ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (0), \ (0)(NAME), \ - assoc_class_tag, \ + assoc_struct_tag, \ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \ BOOST_FUSION_ADAPT_ASSOC_CLASS_C) diff --git a/include/boost/fusion/adapted/class/adapt_class.hpp b/include/boost/fusion/adapted/class/adapt_class.hpp index 42f66632..f3ee7e93 100644 --- a/include/boost/fusion/adapted/class/adapt_class.hpp +++ b/include/boost/fusion/adapted/class/adapt_class.hpp @@ -1,4 +1,6 @@ /*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2009-2010 Hartmut Kaiser Copyright (c) 2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -10,19 +12,25 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #define BOOST_FUSION_ADAPT_CLASS_FILLER_0(A, B, C, D)\ ((A, B, C, D)) BOOST_FUSION_ADAPT_CLASS_FILLER_1 @@ -39,7 +47,7 @@ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (1)TEMPLATE_PARAMS_SEQ, \ (1)NAME_SEQ, \ - class_tag, \ + struct_tag, \ BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \ BOOST_FUSION_ADAPT_CLASS_C) @@ -47,7 +55,7 @@ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (0), \ (0)(NAME), \ - class_tag, \ + struct_tag, \ BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \ BOOST_FUSION_ADAPT_CLASS_C) diff --git a/include/boost/fusion/adapted/class/adapt_class_named.hpp b/include/boost/fusion/adapted/class/adapt_class_named.hpp index edc73b25..8f7ebfd7 100644 --- a/include/boost/fusion/adapted/class/adapt_class_named.hpp +++ b/include/boost/fusion/adapted/class/adapt_class_named.hpp @@ -1,4 +1,6 @@ /*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2009-2010 Hartmut Kaiser Copyright (c) 2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/include/boost/fusion/adapted/class/detail/adapt_base.hpp b/include/boost/fusion/adapted/class/detail/adapt_base.hpp index 511dc046..54b701f3 100644 --- a/include/boost/fusion/adapted/class/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/class/detail/adapt_base.hpp @@ -1,14 +1,35 @@ /*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2010 Christopher Schmidt 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_ADAPTED_DETAIL_CLASS_ADAPT_BASE_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_ADAPT_BASE_HPP +#ifndef BOOST_FUSION_ADAPTED_CLASS_DETAIL_ADAPT_BASE_HPP +#define BOOST_FUSION_ADAPTED_CLASS_DETAIL_ADAPT_BASE_HPP -#include +#include +#include +#include +#include +#include + +//cschmidt: Spirit relies on Fusion defining class_member_proxy in the +//boost::fusion::extension namespace, with two nested types named lvalue and +//rvalue. + +#define BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ)\ + typename detail::get_identity< \ + lvalue \ + , BOOST_PP_SEQ_ELEM(1,TEMPLATE_PARAMS_SEQ) \ + >::type + +#define BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_NON_TEMPLATE_IMPL( \ + TEMPLATE_PARAMS_SEQ) \ + \ + lvalue #define BOOST_FUSION_ADAPT_CLASS_C_BASE(\ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ @@ -21,9 +42,8 @@ , I \ > \ { \ - typedef \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ - type; \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) rvalue; \ \ class_member_proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj)\ : obj(obj) \ @@ -31,13 +51,13 @@ \ template \ class_member_proxy& \ - operator=(Arg val) \ + operator=(Arg const& val) \ { \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \ return *this; \ } \ \ - operator type() \ + operator lvalue() \ { \ return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ } \ @@ -50,34 +70,46 @@ > \ struct struct_member \ { \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ - typedef \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \ - get_type; \ - typedef \ - class_member_proxy< \ - BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ - , I \ - > \ - proxy; \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \ \ - static get_type \ - call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ - { \ - return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ - }; \ + typedef \ + BOOST_PP_IF( \ + BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), \ + BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_TEMPLATE_IMPL, \ + BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_NON_TEMPLATE_IMPL)( \ + TEMPLATE_PARAMS_SEQ) \ + type; \ \ - static proxy \ - call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ + template \ + struct apply \ { \ - return proxy(obj); \ + typedef \ + class_member_proxy< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + > \ + proxy; \ + \ + typedef typename \ + mpl::if_< \ + is_const \ + , BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \ + , proxy \ + >::type \ + type; \ + \ + static proxy \ + call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ + { \ + return proxy(obj); \ + } \ + \ + static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \ + call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ + { \ + return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ + } \ }; \ }; -namespace boost { namespace fusion { namespace extension -{ - template - struct class_member_proxy; -}}} - #endif diff --git a/include/boost/fusion/adapted/class/detail/at_impl.hpp b/include/boost/fusion/adapted/class/detail/at_impl.hpp deleted file mode 100644 index 9b17224b..00000000 --- a/include/boost/fusion/adapted/class/detail/at_impl.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_AT_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_AT_IMPL_HPP - -#include -#include -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct at_impl; - - template <> - struct at_impl - { - template - struct apply - { - typedef - extension::struct_member< - typename remove_const::type - , N::value - > - member; - - typedef typename - mpl::if_< - is_const - , typename member::get_type - , typename member::proxy - >::type - type; - - static type - call(Seq& seq) - { - return member::call(seq); - } - }; - }; - - template <> - struct at_impl - : at_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/begin_impl.hpp b/include/boost/fusion/adapted/class/detail/begin_impl.hpp deleted file mode 100644 index 4255b80d..00000000 --- a/include/boost/fusion/adapted/class/detail/begin_impl.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_BEGIN_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_BEGIN_IMPL_HPP - -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct begin_impl; - - template <> - struct begin_impl - { - template - struct apply - { - typedef - basic_iterator< - class_iterator_tag - , random_access_traversal_tag - , Seq - , 0 - > - type; - - static type - call(Seq& seq) - { - return type(seq,0); - } - }; - }; - - template <> - struct begin_impl - { - template - struct apply - { - typedef - basic_iterator< - assoc_class_iterator_tag - , assoc_class_category - , Seq - , 0 - > - type; - - static type - call(Seq& seq) - { - return type(seq,0); - } - }; - }; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/category_of_impl.hpp b/include/boost/fusion/adapted/class/detail/category_of_impl.hpp deleted file mode 100644 index a8dde001..00000000 --- a/include/boost/fusion/adapted/class/detail/category_of_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_CATEGORY_OF_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_CATEGORY_OF_IMPL_HPP - -#include - -namespace boost { namespace fusion -{ - namespace extension - { - template - struct category_of_impl; - - template<> - struct category_of_impl - : category_of_impl - {}; - - template<> - struct category_of_impl - : category_of_impl - {}; - } -}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/deref_data_impl.hpp b/include/boost/fusion/adapted/class/detail/deref_data_impl.hpp deleted file mode 100644 index 60737295..00000000 --- a/include/boost/fusion/adapted/class/detail/deref_data_impl.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_DEREF_DATA_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_DEREF_DATA_IMPL_HPP - -namespace boost { namespace fusion { namespace extension -{ - template - struct deref_data_impl; - - template <> - struct deref_data_impl - : deref_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/deref_impl.hpp b/include/boost/fusion/adapted/class/detail/deref_impl.hpp deleted file mode 100644 index ed0cf535..00000000 --- a/include/boost/fusion/adapted/class/detail/deref_impl.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_DEREF_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_DEREF_IMPL_HPP - -#include -#include -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct deref_impl; - - template <> - struct deref_impl - { - template - struct apply - { - typedef - extension::struct_member< - typename remove_const::type - , It::index::value - > - member; - - typedef typename - mpl::if_< - is_const - , typename member::get_type - , typename member::proxy - >::type - type; - - static type - call(It const& it) - { - return member::call(*it.seq); - } - }; - }; - - template <> - struct deref_impl - : deref_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/end_impl.hpp b/include/boost/fusion/adapted/class/detail/end_impl.hpp deleted file mode 100644 index 934a8ba9..00000000 --- a/include/boost/fusion/adapted/class/detail/end_impl.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_END_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_END_IMPL_HPP - -#include -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct end_impl; - - template <> - struct end_impl - { - template - struct apply - { - typedef - basic_iterator< - class_iterator_tag - , random_access_traversal_tag - , Seq - , struct_size::type>::value - > - type; - - static type - call(Seq& seq) - { - return type(seq,0); - } - }; - }; - - template <> - struct end_impl - { - template - struct apply - { - typedef - basic_iterator< - assoc_class_iterator_tag - , assoc_class_category - , Seq - , struct_size::type>::value - > - type; - - static type - call(Seq& seq) - { - return type(seq,0); - } - }; - }; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/extension.hpp b/include/boost/fusion/adapted/class/detail/extension.hpp index 3d505da8..0ad7c66e 100644 --- a/include/boost/fusion/adapted/class/detail/extension.hpp +++ b/include/boost/fusion/adapted/class/detail/extension.hpp @@ -1,23 +1,33 @@ /*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2010 Christopher Schmidt 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_ADAPTED_DETAIL_CLASS_EXTENSION_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_EXTENSION_HPP +#ifndef BOOST_FUSION_ADAPTED_CLASS_DETAIL_EXTENSION_HPP +#define BOOST_FUSION_ADAPTED_CLASS_DETAIL_EXTENSION_HPP -#include +#include +#include namespace boost { namespace fusion { - struct class_tag; - struct class_iterator_tag; - struct assoc_class_tag; - struct assoc_class_iterator_tag; + namespace detail + { + template + struct get_identity + : remove_const::type> + {}; + } - typedef assoc_struct_category assoc_class_category; + namespace extension + { + template + struct class_member_proxy; + } }} #endif diff --git a/include/boost/fusion/adapted/class/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/class/detail/is_sequence_impl.hpp deleted file mode 100644 index d35e212c..00000000 --- a/include/boost/fusion/adapted/class/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_IS_SEQUENCE_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_IS_SEQUENCE_IMPL_HPP - -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct is_sequence_impl; - - template<> - struct is_sequence_impl - : is_sequence_impl - {}; - - template <> - struct is_sequence_impl - : is_sequence_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/is_view_impl.hpp b/include/boost/fusion/adapted/class/detail/is_view_impl.hpp deleted file mode 100644 index f52976e4..00000000 --- a/include/boost/fusion/adapted/class/detail/is_view_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_IS_VIEW_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_IS_VIEW_IMPL_HPP - -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct is_view_impl; - - template<> - struct is_view_impl - : is_view_impl - {}; - - template <> - struct is_view_impl - : is_view_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/key_of_impl.hpp b/include/boost/fusion/adapted/class/detail/key_of_impl.hpp deleted file mode 100644 index 3d76d4a3..00000000 --- a/include/boost/fusion/adapted/class/detail/key_of_impl.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_KEY_OF_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_KEY_OF_IMPL_HPP - -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct key_of_impl; - - template <> - struct key_of_impl - : key_of_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/size_impl.hpp b/include/boost/fusion/adapted/class/detail/size_impl.hpp deleted file mode 100644 index a214bb98..00000000 --- a/include/boost/fusion/adapted/class/detail/size_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_SIZE_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_SIZE_IMPL_HPP - -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct size_impl; - - template <> - struct size_impl - : size_impl - {}; - - template <> - struct size_impl - : size_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/value_at_impl.hpp b/include/boost/fusion/adapted/class/detail/value_at_impl.hpp deleted file mode 100644 index 0fd81f10..00000000 --- a/include/boost/fusion/adapted/class/detail/value_at_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_VALUE_AT_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_VALUE_AT_IMPL_HPP - -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct value_at_impl; - - template <> - struct value_at_impl - : value_at_impl - {}; - - template <> - struct value_at_impl - : value_at_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/value_of_data_impl.hpp b/include/boost/fusion/adapted/class/detail/value_of_data_impl.hpp deleted file mode 100644 index 624200a6..00000000 --- a/include/boost/fusion/adapted/class/detail/value_of_data_impl.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_VALUE_OF_DATA_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_VALUE_OF_DATA_IMPL_HPP - -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct value_of_data_impl; - - template <> - struct value_of_data_impl - : value_of_data_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/class/detail/value_of_impl.hpp b/include/boost/fusion/adapted/class/detail/value_of_impl.hpp deleted file mode 100644 index 49e5bf1c..00000000 --- a/include/boost/fusion/adapted/class/detail/value_of_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - 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_ADAPTED_DETAIL_CLASS_VALUE_OF_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_VALUE_OF_IMPL_HPP - -#include - -namespace boost { namespace fusion { namespace extension -{ - template - struct value_of_impl; - - template <> - struct value_of_impl - : value_of_impl - {}; - - template <> - struct value_of_impl - : value_of_impl - {}; -}}} - -#endif diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index 5708bfc3..c6c991d1 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -13,6 +13,10 @@ #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 538b2f18..0758af53 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -11,6 +11,10 @@ #include #include +#include +#include +#include +#include #include #include diff --git a/include/boost/fusion/adapted/struct/adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/adapt_struct_named.hpp index 1209a4f1..86bd8725 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct_named.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct_named.hpp @@ -1,4 +1,6 @@ /*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2009-2010 Hartmut Kaiser Copyright (c) 2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 70a3cd8e..c1b1b923 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -1,16 +1,20 @@ /*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2009-2010 Christopher Schmidt 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_ADAPTED_DETAIL_STRUCT_ADAPT_BASE_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_ADAPT_BASE_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_HPP #include #include +#include +#include #include #include #include @@ -20,11 +24,14 @@ #include #include #include -#include +#include +#include #include #define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \ - BOOST_PP_SEQ_HEAD(SEQ) + BOOST_PP_SEQ_HEAD(SEQ) \ + BOOST_PP_EMPTY() + #define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(SEQ) \ BOOST_PP_IF( \ BOOST_PP_SEQ_HEAD(SEQ), \ @@ -47,7 +54,7 @@ #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS # define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ - MODIFIER, TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG) \ + MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -61,7 +68,7 @@ }; #else # define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ - MODIFIER, TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG) \ + MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -90,19 +97,46 @@ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ \ template \ - static typename add_reference::type \ - call(Seq& seq) \ + struct apply \ { \ - return seq.PREFIX \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \ - } \ + typedef typename \ + add_reference< \ + typename mpl::eval_if< \ + is_const \ + , add_const \ + , mpl::identity \ + >::type \ + >::type \ + type; \ \ - template \ - static typename add_reference::type>::type \ - call(Seq const& seq) \ + static type \ + call(Seq& seq) \ + { \ + return seq.PREFIX \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \ + } \ + }; \ + }; \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ + > \ + struct struct_member_name< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + > \ + { \ + typedef char const* type; \ + \ + static type \ + call() \ { \ - return seq.PREFIX \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \ + return BOOST_PP_STRINGIZE( \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)); \ } \ }; @@ -116,9 +150,9 @@ namespace boost namespace traits \ { \ BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ - BOOST_PP_EMPTY(),TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG) \ + BOOST_PP_EMPTY(), TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ - const,TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG) \ + const, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ } \ \ namespace extension \ diff --git a/include/boost/fusion/adapted/struct/detail/at_impl.hpp b/include/boost/fusion/adapted/struct/detail/at_impl.hpp index 09db935f..febb6335 100644 --- a/include/boost/fusion/adapted/struct/detail/at_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/at_impl.hpp @@ -7,13 +7,10 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_AT_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_AT_IMPL_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_AT_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_AT_IMPL_HPP -#include -#include -#include -#include +#include namespace boost { namespace fusion { namespace extension { @@ -25,28 +22,11 @@ namespace boost { namespace fusion { namespace extension { template struct apply - { - typedef - extension::struct_member< - typename remove_const::type - , N::value - > - member; - - typedef typename - mpl::eval_if< - is_const - , detail::cref_result - , detail::ref_result - >::type - type; - - static type - call(Seq& seq) - { - return member::call(seq); - } - }; + : extension::struct_member< + typename remove_const::type + , N::value + >::template apply + {}; }; template <> diff --git a/include/boost/fusion/adapted/struct/detail/begin_impl.hpp b/include/boost/fusion/adapted/struct/detail/begin_impl.hpp index 583d81b6..80321ee1 100644 --- a/include/boost/fusion/adapted/struct/detail/begin_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/begin_impl.hpp @@ -7,8 +7,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_BEGIN_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_BEGIN_IMPL_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_BEGIN_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_BEGIN_IMPL_HPP #include @@ -48,7 +48,7 @@ namespace boost { namespace fusion { namespace extension { typedef basic_iterator< - assoc_struct_iterator_tag + struct_iterator_tag , assoc_struct_category , Seq , 0 diff --git a/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp b/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp index b7b1a14c..81350e6a 100644 --- a/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp @@ -7,8 +7,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_CATEGORY_OF_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_CATEGORY_OF_IMPL_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_CATEGORY_OF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_CATEGORY_OF_IMPL_HPP namespace boost { namespace fusion { diff --git a/include/boost/fusion/adapted/struct/detail/deref_data_impl.hpp b/include/boost/fusion/adapted/struct/detail/deref_data_impl.hpp index ce4a79de..d3b6ced6 100644 --- a/include/boost/fusion/adapted/struct/detail/deref_data_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/deref_data_impl.hpp @@ -5,8 +5,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_DATA_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_DATA_IMPL_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_DATA_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_DATA_IMPL_HPP namespace boost { namespace fusion { namespace extension { @@ -14,8 +14,8 @@ namespace boost { namespace fusion { namespace extension struct deref_data_impl; template <> - struct deref_data_impl - : deref_impl + struct deref_data_impl + : deref_impl {}; }}} diff --git a/include/boost/fusion/adapted/struct/detail/deref_impl.hpp b/include/boost/fusion/adapted/struct/detail/deref_impl.hpp index a54abbfc..498617a3 100644 --- a/include/boost/fusion/adapted/struct/detail/deref_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/deref_impl.hpp @@ -5,13 +5,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_IMPL_HPP - -#include -#include -#include -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_IMPL_HPP namespace boost { namespace fusion { namespace extension { @@ -24,33 +19,23 @@ namespace boost { namespace fusion { namespace extension template struct apply { - typedef - extension::struct_member< - typename remove_const::type - , It::index::value - > - member; + typedef typename + extension::struct_member< + typename remove_const::type + , It::index::value + >::template apply + impl; - typedef typename - mpl::eval_if< - is_const - , detail::cref_result - , detail::ref_result - >::type - type; + typedef typename impl::type type; - static type - call(It const& it) - { - return member::call(*it.seq); - } + static + type + call(It const& it) + { + return impl::call(*it.seq); + } }; }; - - template <> - struct deref_impl - : deref_impl - {}; }}} #endif diff --git a/include/boost/fusion/adapted/struct/detail/end_impl.hpp b/include/boost/fusion/adapted/struct/detail/end_impl.hpp index 738ffdd0..e4f92056 100644 --- a/include/boost/fusion/adapted/struct/detail/end_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/end_impl.hpp @@ -7,11 +7,10 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_END_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_END_IMPL_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP #include -#include namespace boost { namespace fusion { namespace extension { @@ -49,7 +48,7 @@ namespace boost { namespace fusion { namespace extension { typedef basic_iterator< - assoc_struct_iterator_tag + struct_iterator_tag , assoc_struct_category , Seq , struct_size::type>::value diff --git a/include/boost/fusion/adapted/struct/detail/extension.hpp b/include/boost/fusion/adapted/struct/detail/extension.hpp index 892155eb..4896859d 100644 --- a/include/boost/fusion/adapted/struct/detail/extension.hpp +++ b/include/boost/fusion/adapted/struct/detail/extension.hpp @@ -7,8 +7,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_EXTENSION_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_EXTENSION_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_EXTENSION_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_EXTENSION_HPP #include @@ -17,7 +17,6 @@ namespace boost { namespace fusion struct struct_tag; struct struct_iterator_tag; struct assoc_struct_tag; - struct assoc_struct_iterator_tag; struct fusion_sequence_tag; struct assoc_struct_category @@ -31,6 +30,9 @@ namespace boost { namespace fusion template struct struct_member; + template + struct struct_member_name; + template struct struct_assoc_key; diff --git a/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp index e71bb0e2..6f8adde5 100644 --- a/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp @@ -1,13 +1,14 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt 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_ADAPTED_DETAIL_STRUCT_IS_SEQUENCE_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_IS_SEQUENCE_IMPL_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_SEQUENCE_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_SEQUENCE_IMPL_HPP #include diff --git a/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp b/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp index 61ca61fa..0580018d 100644 --- a/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp @@ -1,13 +1,14 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt 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_ADAPTED_DETAIL_STRUCT_IS_VIEW_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_IS_VIEW_IMPL_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP #include diff --git a/include/boost/fusion/adapted/struct/detail/key_of_impl.hpp b/include/boost/fusion/adapted/struct/detail/key_of_impl.hpp index 28e6bbf0..d24a24b1 100644 --- a/include/boost/fusion/adapted/struct/detail/key_of_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/key_of_impl.hpp @@ -5,10 +5,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_KEY_OF_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_KEY_OF_IMPL_HPP - -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_KEY_OF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_KEY_OF_IMPL_HPP namespace boost { namespace fusion { namespace extension { @@ -16,18 +14,15 @@ namespace boost { namespace fusion { namespace extension struct key_of_impl; template <> - struct key_of_impl + struct key_of_impl { template struct apply - { - typedef typename - extension::struct_assoc_key< - typename remove_const::type - , It::index::value - >::type - type; - }; + : extension::struct_assoc_key< + typename remove_const::type + , It::index::value + > + {}; }; }}} diff --git a/include/boost/fusion/adapted/struct/detail/proxy_type.hpp b/include/boost/fusion/adapted/struct/detail/proxy_type.hpp index ed9a9625..1d86df12 100644 --- a/include/boost/fusion/adapted/struct/detail/proxy_type.hpp +++ b/include/boost/fusion/adapted/struct/detail/proxy_type.hpp @@ -1,12 +1,13 @@ /*============================================================================= + Copyright (c) 2009-2010 Hartmut Kaiser Copyright (c) 2010 Christopher Schmidt 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_ADAPTED_DETAIL_STRUCT_PROXY_TYPE_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_PROXY_TYPE_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PROXY_TYPE_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PROXY_TYPE_HPP #include #include diff --git a/include/boost/fusion/adapted/struct/detail/size_impl.hpp b/include/boost/fusion/adapted/struct/detail/size_impl.hpp index b7b1ace8..43a57057 100644 --- a/include/boost/fusion/adapted/struct/detail/size_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/size_impl.hpp @@ -1,15 +1,14 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt 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_ADAPTED_DETAIL_STRUCT_SIZE_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_SIZE_IMPL_HPP - -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_SIZE_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_SIZE_IMPL_HPP namespace boost { namespace fusion { namespace extension { diff --git a/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp b/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp index 6f139219..5ecf4ac7 100644 --- a/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp @@ -1,15 +1,14 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt 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_ADAPTED_DETAIL_STRUCT_VALUE_AT_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_AT_IMPL_HPP - -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_AT_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_AT_IMPL_HPP namespace boost { namespace fusion { namespace extension { diff --git a/include/boost/fusion/adapted/struct/detail/value_of_data_impl.hpp b/include/boost/fusion/adapted/struct/detail/value_of_data_impl.hpp index 682adbbf..4528b854 100644 --- a/include/boost/fusion/adapted/struct/detail/value_of_data_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/value_of_data_impl.hpp @@ -5,8 +5,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_OF_DATA_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_OF_DATA_IMPL_HPP +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_DATA_IMPL_HPP namespace boost { namespace fusion { namespace extension { @@ -14,8 +14,8 @@ namespace boost { namespace fusion { namespace extension struct value_of_data_impl; template <> - struct value_of_data_impl - : value_of_impl + struct value_of_data_impl + : value_of_impl {}; }}} diff --git a/include/boost/fusion/adapted/struct/detail/value_of_impl.hpp b/include/boost/fusion/adapted/struct/detail/value_of_impl.hpp index 7d8bf571..55d37ed7 100644 --- a/include/boost/fusion/adapted/struct/detail/value_of_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/value_of_impl.hpp @@ -5,10 +5,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_OF_IMPL_HPP -#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_OF_IMPL_HPP - -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_IMPL_HPP namespace boost { namespace fusion { namespace extension { @@ -20,20 +18,12 @@ namespace boost { namespace fusion { namespace extension { template struct apply - { - typedef typename - extension::struct_member< - typename remove_const::type - , It::index::value - >::type - type; - }; + : extension::struct_member< + typename remove_const::type + , It::index::value + > + {}; }; - - template <> - struct value_of_impl - : value_of_impl - {}; }}} #endif diff --git a/include/boost/fusion/sequence/comparison/detail/greater.hpp b/include/boost/fusion/sequence/comparison/detail/greater.hpp index 6807d367..e7b6a034 100644 --- a/include/boost/fusion/sequence/comparison/detail/greater.hpp +++ b/include/boost/fusion/sequence/comparison/detail/greater.hpp @@ -32,9 +32,8 @@ namespace boost { namespace fusion { namespace detail static bool call(I1 const& a, I2 const& b, mpl::false_) { - return *a > *b - || !(*b > *a) - && call(fusion::next(a), fusion::next(b)); + return *a > *b || + (!(*b > *a) && call(fusion::next(a), fusion::next(b))); } template diff --git a/include/boost/fusion/sequence/comparison/detail/less.hpp b/include/boost/fusion/sequence/comparison/detail/less.hpp index 0c457c41..a8b0ce84 100644 --- a/include/boost/fusion/sequence/comparison/detail/less.hpp +++ b/include/boost/fusion/sequence/comparison/detail/less.hpp @@ -32,9 +32,8 @@ namespace boost { namespace fusion { namespace detail static bool call(I1 const& a, I2 const& b, mpl::false_) { - return *a < *b - || !(*b < *a) - && call(fusion::next(a), fusion::next(b)); + return *a < *b || + (!(*b < *a) && call(fusion::next(a), fusion::next(b))); } template