|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64703 - in sandbox/SOC/2009/fusion: boost/fusion/adapted/detail/class boost/fusion/adapted/detail/struct boost/fusion/container/vector/detail/pp boost/fusion/view/reverse_view/detail libs/fusion/test/suite1 libs/fusion/test/suite1/sequence
From: mr.chr.schmidt_at_[hidden]
Date: 2010-08-09 15:52:43
Author: cschmidt
Date: 2010-08-09 15:52:30 EDT (Mon, 09 Aug 2010)
New Revision: 64703
URL: http://svn.boost.org/trac/boost/changeset/64703
Log:
updated adapt macros & gcc 4.5.1 fixes
Text files modified:
sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/adapt_base.hpp | 2 ++
sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/extension.hpp | 15 ++++++---------
sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp | 31 +++++++++++++++++++++++++------
sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/pp/vector.hpp | 1 -
sandbox/SOC/2009/fusion/boost/fusion/view/reverse_view/detail/reverse_view_fwd.hpp | 2 +-
sandbox/SOC/2009/fusion/libs/fusion/test/suite1/Jamfile | 4 ++--
sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/adapt_class.cpp | 8 +++++++-
sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/adapt_struct.cpp | 19 ++++++++++++++++++-
8 files changed, 61 insertions(+), 21 deletions(-)
Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/adapt_base.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/adapt_base.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/adapt_base.hpp 2010-08-09 15:52:30 EDT (Mon, 09 Aug 2010)
@@ -81,6 +81,8 @@
> \
{ \
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \
+ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
+ TEMPLATE_PARAMS_SEQ) \
\
typedef \
BOOST_PP_IF( \
Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/extension.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/extension.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/extension.hpp 2010-08-09 15:52:30 EDT (Mon, 09 Aug 2010)
@@ -10,15 +10,12 @@
#ifndef BOOST_FUSION_ADAPTED_DETAIL_CLASS_EXTENSION_HPP
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_EXTENSION_HPP
-namespace boost { namespace fusion
+namespace boost { namespace fusion { namespace detail
{
- namespace detail
- {
- template<typename T, typename Dummy>
- struct get_identity
- : identity<T>
- {};
- }
-}}
+ template<typename T, typename Dummy>
+ struct get_identity
+ : identity<T>
+ {};
+}}}
#endif
Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp 2010-08-09 15:52:30 EDT (Mon, 09 Aug 2010)
@@ -12,7 +12,6 @@
#include <boost/config.hpp>
#include <boost/fusion/support/tag_of_fwd.hpp>
-
#include <boost/preprocessor/stringize.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/seq/size.hpp>
@@ -83,6 +82,23 @@
I, \
ATTRIBUTE)
+#ifdef BOOST_MSVC
+# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM(R,_,ELEM) \
+ typedef ELEM ELEM;
+# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL(SEQ) \
+ BOOST_PP_SEQ_FOR_EACH( \
+ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM, \
+ _, \
+ BOOST_PP_SEQ_TAIL(SEQ))
+# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS(SEQ) \
+ BOOST_PP_IF( \
+ BOOST_PP_SEQ_HEAD(SEQ), \
+ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL, \
+ BOOST_PP_TUPLE_EAT(1))(SEQ)
+#else
+# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS(SEQ)
+#endif
+
#define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \
\
@@ -94,16 +110,19 @@
, I \
> \
{ \
- typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
+ typedef \
+ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
+ attribute_type; \
+ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
+ TEMPLATE_PARAMS_SEQ) \
+ \
+ typedef attribute_type type; \
\
template<typename SeqRef> \
struct apply \
{ \
typedef typename \
- detail::forward_as< \
- SeqRef \
- , BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
- >::type \
+ detail::forward_as<SeqRef, attribute_type>::type \
type; \
\
static type \
Modified: sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/pp/vector.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/pp/vector.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/pp/vector.hpp 2010-08-09 15:52:30 EDT (Mon, 09 Aug 2010)
@@ -14,7 +14,6 @@
#include <boost/fusion/container/vector/detail/pp/vector_n_chooser.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/bool.hpp>
-#include <boost/type_traits/add_const.hpp>
#include <boost/fusion/container/detail/forward_interface.hpp>
namespace boost { namespace fusion
Modified: sandbox/SOC/2009/fusion/boost/fusion/view/reverse_view/detail/reverse_view_fwd.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/reverse_view/detail/reverse_view_fwd.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/reverse_view/detail/reverse_view_fwd.hpp 2010-08-09 15:52:30 EDT (Mon, 09 Aug 2010)
@@ -23,7 +23,7 @@
BOOST_WORKAROUND(__GNUC_MINOR__,==5)
//cschmidt: the internals of BOOST_WORKAROUND do not allow comparing
//with 0!
-# if __GNUC_PATCHLEVEL__==0
+# if __GNUC_PATCHLEVEL__<=1
# define BOOST_FUSION_REVERSE_VIEW_USE_FORWARD_AS_GCC_HELPER
template<typename TestType,typename Type>
Modified: sandbox/SOC/2009/fusion/libs/fusion/test/suite1/Jamfile
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/suite1/Jamfile (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/suite1/Jamfile 2010-08-09 15:52:30 EDT (Mon, 09 Aug 2010)
@@ -11,11 +11,11 @@
import testing ;
project
- : requirements
+ : requirements
<define>BOOST_FUSION_ENABLE_STATIC_ASSERTS
<warnings>all
<toolset>gcc:<cxxflags>-Wno-long-long
- ;
+ ;
{
test-suite fusion_1 : ;
Modified: sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/adapt_class.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/adapt_class.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/adapt_class.cpp 2010-08-09 15:52:30 EDT (Mon, 09 Aug 2010)
@@ -52,9 +52,10 @@
int y;
};
+#if !BOOST_WORKAROUND(__GNUC__,<4)
class point_with_private_members
{
- friend class boost::fusion::extension::access;
+ friend struct boost::fusion::extension::access;
public:
point_with_private_members() : x(0), y(0) {}
@@ -69,6 +70,7 @@
int x;
int y;
};
+#endif
}
BOOST_FUSION_ADAPT_CLASS(
@@ -77,11 +79,13 @@
(int, int, obj.get_y(), obj.set_y(val))
)
+#if !BOOST_WORKAROUND(__GNUC__,<4)
BOOST_FUSION_ADAPT_CLASS(
ns::point_with_private_members,
(int, int, obj.get_x(), obj.set_x(val))
(int, int, obj.get_y(), obj.set_y(val))
)
+#endif
int
main()
@@ -149,6 +153,7 @@
, boost::mpl::front<ns::point>::type>));
}
+#if !BOOST_WORKAROUND(__GNUC__,<4)
{
BOOST_MPL_ASSERT_NOT((traits::is_view<ns::point_with_private_members>));
ns::point_with_private_members p(123, 456);
@@ -168,6 +173,7 @@
BOOST_TEST(front(p) == 6);
BOOST_TEST(back(p) == 9);
}
+#endif
return boost::report_errors();
}
Modified: sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/adapt_struct.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/adapt_struct.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/adapt_struct.cpp 2010-08-09 15:52:30 EDT (Mon, 09 Aug 2010)
@@ -11,6 +11,7 @@
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/front.hpp>
#include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
@@ -22,7 +23,10 @@
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
+#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/static_assert.hpp>
#include <iostream>
@@ -36,9 +40,10 @@
int y;
};
+#if !BOOST_WORKAROUND(__GNUC__,<4)
struct point_with_private_attributes
{
- friend class boost::fusion::extension::access;
+ friend struct boost::fusion::extension::access;
private:
int x;
@@ -48,6 +53,7 @@
point_with_private_attributes(int x, int y):x(x),y(y)
{}
};
+#endif
}
BOOST_FUSION_ADAPT_STRUCT(
@@ -56,11 +62,13 @@
(int, y)
)
+#if !BOOST_WORKAROUND(__GNUC__,<4)
BOOST_FUSION_ADAPT_STRUCT(
ns::point_with_private_attributes,
(int, x)
(int, y)
)
+#endif
struct s { int m; };
BOOST_FUSION_ADAPT_STRUCT(s, (int, m))
@@ -133,6 +141,14 @@
}
{
+ BOOST_MPL_ASSERT((boost::mpl::is_sequence<ns::point>));
+ BOOST_MPL_ASSERT((boost::is_same<
+ result_of::value_at_c<ns::point,0>::type
+ , boost::mpl::front<ns::point>::type>));
+ }
+
+#if !BOOST_WORKAROUND(__GNUC__,<4)
+ {
ns::point_with_private_attributes p(123, 456);
std::cout << at_c<0>(p) << std::endl;
@@ -140,6 +156,7 @@
std::cout << p << std::endl;
BOOST_TEST(p == make_vector(123, 456));
}
+#endif
return boost::report_errors();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk