|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75394 - in trunk: boost/fusion/support boost/fusion/view/detail boost/fusion/view/nview boost/fusion/view/zip_view boost/fusion/view/zip_view/detail libs/fusion/test/functional
From: joel_at_[hidden]
Date: 2011-11-07 17:07:07
Author: djowel
Date: 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
New Revision: 75394
URL: http://svn.boost.org/trac/boost/changeset/75394
Log:
C++11 patches by Michel Morin
Text files modified:
trunk/boost/fusion/support/deduce_sequence.hpp | 8 ++++++++
trunk/boost/fusion/view/detail/strictest_traversal.hpp | 8 ++++++++
trunk/boost/fusion/view/nview/nview.hpp | 11 +++++++++++
trunk/boost/fusion/view/zip_view/detail/end_impl.hpp | 2 +-
trunk/boost/fusion/view/zip_view/detail/value_at_impl.hpp | 8 ++++++++
trunk/boost/fusion/view/zip_view/detail/value_of_impl.hpp | 8 ++++++++
trunk/boost/fusion/view/zip_view/zip_view.hpp | 16 ++++++++++++++++
trunk/libs/fusion/test/functional/invoke.cpp | 2 ++
trunk/libs/fusion/test/functional/invoke_function_object.cpp | 2 ++
trunk/libs/fusion/test/functional/unfused.cpp | 2 +-
trunk/libs/fusion/test/functional/unfused_typed.cpp | 2 +-
11 files changed, 66 insertions(+), 3 deletions(-)
Modified: trunk/boost/fusion/support/deduce_sequence.hpp
==============================================================================
--- trunk/boost/fusion/support/deduce_sequence.hpp (original)
+++ trunk/boost/fusion/support/deduce_sequence.hpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -12,6 +12,7 @@
#include <boost/fusion/support/deduce.hpp>
#include <boost/fusion/container/vector/convert.hpp>
#include <boost/fusion/view/transform_view.hpp>
+#include <boost/config.hpp>
namespace boost { namespace fusion { namespace traits
@@ -29,6 +30,13 @@
struct result< Self(T) >
: fusion::traits::deduce<T>
{ };
+
+ // never called, but needed for decltype-based result_of (C++0x)
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template <typename T>
+ typename result< deducer(T) >::type
+ operator()(T&&) const;
+#endif
};
}
Modified: trunk/boost/fusion/view/detail/strictest_traversal.hpp
==============================================================================
--- trunk/boost/fusion/view/detail/strictest_traversal.hpp (original)
+++ trunk/boost/fusion/view/detail/strictest_traversal.hpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -8,6 +8,7 @@
#if !defined(FUSION_STRICTEST_TRAVERSAL_20060123_2101)
#define FUSION_STRICTEST_TRAVERSAL_20060123_2101
+#include <boost/config.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/if.hpp>
#include <boost/fusion/support/category_of.hpp>
@@ -53,6 +54,13 @@
typedef typename stricter_traversal<tag1,tag2>::type type;
};
+
+ // never called, but needed for decltype-based result_of (C++0x)
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template<typename StrictestSoFar, typename Next>
+ typename result<strictest_traversal_impl(StrictestSoFar, Next)>::type
+ operator()(StrictestSoFar&&, Next&&) const;
+#endif
};
template<typename Sequence>
Modified: trunk/boost/fusion/view/nview/nview.hpp
==============================================================================
--- trunk/boost/fusion/view/nview/nview.hpp (original)
+++ trunk/boost/fusion/view/nview/nview.hpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -23,6 +23,8 @@
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/view/transform_view.hpp>
+#include <boost/config.hpp>
+
namespace boost { namespace fusion
{
namespace detail
@@ -35,12 +37,21 @@
template<typename U>
struct result<addref(U)> : add_reference<U> {};
+#ifdef BOOST_NO_RVALUE_REFERENCES
template <typename T>
typename add_reference<T>::type
operator()(T& x) const
{
return x;
}
+#else
+ template <typename T>
+ typename result<addref(T)>::type
+ operator()(T&& x) const
+ {
+ return x;
+ }
+#endif
};
struct addconstref
Modified: trunk/boost/fusion/view/zip_view/detail/end_impl.hpp
==============================================================================
--- trunk/boost/fusion/view/zip_view/detail/end_impl.hpp (original)
+++ trunk/boost/fusion/view/zip_view/detail/end_impl.hpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -62,7 +62,7 @@
template<typename Seq>
typename result<endpoints(Seq const&)>::type
- operator()(Seq const& seq)
+ operator()(Seq const& seq) const
{
return fusion::advance<M>(fusion::begin(seq));
}
Modified: trunk/boost/fusion/view/zip_view/detail/value_at_impl.hpp
==============================================================================
--- trunk/boost/fusion/view/zip_view/detail/value_at_impl.hpp (original)
+++ trunk/boost/fusion/view/zip_view/detail/value_at_impl.hpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -16,6 +16,7 @@
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
+#include <boost/config.hpp>
namespace boost { namespace fusion {
@@ -35,6 +36,13 @@
mpl::identity<unused_type>,
result_of::value_at<typename remove_reference<Seq>::type, N> >
{};
+
+ // never called, but needed for decltype-based result_of (C++0x)
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template<typename Seq>
+ typename result<poly_value_at(Seq)>::type
+ operator()(Seq&&) const;
+#endif
};
}
Modified: trunk/boost/fusion/view/zip_view/detail/value_of_impl.hpp
==============================================================================
--- trunk/boost/fusion/view/zip_view/detail/value_of_impl.hpp (original)
+++ trunk/boost/fusion/view/zip_view/detail/value_of_impl.hpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -16,6 +16,7 @@
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
+#include <boost/config.hpp>
namespace boost { namespace fusion
{
@@ -34,6 +35,13 @@
mpl::identity<unused_type>,
result_of::value_of<It> >
{};
+
+ // never called, but needed for decltype-based result_of (C++0x)
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template<typename It>
+ typename result<poly_value_of(It)>::type
+ operator()(It&&) const;
+#endif
};
}
Modified: trunk/boost/fusion/view/zip_view/zip_view.hpp
==============================================================================
--- trunk/boost/fusion/view/zip_view/zip_view.hpp (original)
+++ trunk/boost/fusion/view/zip_view/zip_view.hpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -37,6 +37,8 @@
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/is_reference.hpp>
+#include <boost/config.hpp>
+
namespace boost { namespace fusion {
namespace detail
@@ -64,6 +66,13 @@
result_of::size<SeqClass>,
mpl::int_<high_int> >::type type;
};
+
+ // never called, but needed for decltype-based result_of (C++0x)
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template<typename Seq>
+ typename result<seq_ref_size(Seq)>::type
+ operator()(Seq&&) const;
+#endif
};
struct poly_min
@@ -78,6 +87,13 @@
typedef typename remove_reference<Rhs>::type rhs;
typedef typename mpl::min<lhs, rhs>::type type;
};
+
+ // never called, but needed for decltype-based result_of (C++0x)
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template<typename Lhs, typename Rhs>
+ typename result<poly_min(Lhs, Rhs)>::type
+ operator()(Lhs&&, Rhs&&) const;
+#endif
};
template<typename Sequences>
Modified: trunk/libs/fusion/test/functional/invoke.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/invoke.cpp (original)
+++ trunk/libs/fusion/test/functional/invoke.cpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -72,6 +72,8 @@
int operator()(int i, object &, object_nc &) { return 10 + i; }
int operator()(int i, object &, object_nc &) const { return 11 + i; }
+ int operator()(int i, object const &, object_nc &);
+ int operator()(int i, object const &, object_nc &) const;
};
struct nullary_fobj
Modified: trunk/libs/fusion/test/functional/invoke_function_object.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/invoke_function_object.cpp (original)
+++ trunk/libs/fusion/test/functional/invoke_function_object.cpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -75,6 +75,8 @@
int operator()(int i, object &, object_nc &) { return 10 + i; }
int operator()(int i, object &, object_nc &) const { return 11 + i; }
+ int operator()(int i, object const &, object_nc &);
+ int operator()(int i, object const &, object_nc &) const;
};
struct nullary_fobj
Modified: trunk/libs/fusion/test/functional/unfused.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/unfused.cpp (original)
+++ trunk/libs/fusion/test/functional/unfused.cpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -71,7 +71,7 @@
typedef fusion::unfused< test_func<> > t;
BOOST_TEST(( is_same< boost::result_of< t () >::type, long >::value ));
- BOOST_TEST(( is_same< boost::result_of< t (int) >::type, long >::value ));
+ BOOST_TEST(( is_same< boost::result_of< t (int &) >::type, long >::value ));
}
int main()
Modified: trunk/libs/fusion/test/functional/unfused_typed.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/unfused_typed.cpp (original)
+++ trunk/libs/fusion/test/functional/unfused_typed.cpp 2011-11-07 17:07:05 EST (Mon, 07 Nov 2011)
@@ -85,7 +85,7 @@
typedef fusion::unfused_typed< test_func<>, types0 > t0;
BOOST_TEST(( is_same< boost::result_of< t0 () >::type, long >::value ));
typedef fusion::unfused_typed< test_func<>, types1 > t1;
- BOOST_TEST(( is_same< boost::result_of< t1 (int) >::type, long >::value ));
+ BOOST_TEST(( is_same< boost::result_of< t1 (long &) >::type, long >::value ));
}
#if defined(BOOST_MSVC) && BOOST_MSVC < 1400
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