|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85108 - trunk/boost/proto/functional/std
From: eric_at_[hidden]
Date: 2013-07-22 13:03:01
Author: eric_niebler
Date: 2013-07-22 13:03:01 EDT (Mon, 22 Jul 2013)
New Revision: 85108
URL: http://svn.boost.org/trac/boost/changeset/85108
Log:
revert previous hasty change
Text files modified:
trunk/boost/proto/functional/std/utility.hpp | 93 ++++++++++++++++++++-------------------
1 files changed, 48 insertions(+), 45 deletions(-)
Modified: trunk/boost/proto/functional/std/utility.hpp
==============================================================================
--- trunk/boost/proto/functional/std/utility.hpp Mon Jul 22 12:24:16 2013 (r85107)
+++ trunk/boost/proto/functional/std/utility.hpp 2013-07-22 13:03:01 EDT (Mon, 22 Jul 2013) (r85108)
@@ -13,7 +13,6 @@
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/proto/proto_fwd.hpp>
-#include <boost/proto/detail/poly_function.hpp>
namespace boost { namespace proto { namespace functional
{
@@ -53,39 +52,41 @@
/// A PolymorphicFunctionObject type that returns
/// the first element of a std::pair..
struct first
- : proto::detail::poly_function<first>
{
BOOST_PROTO_CALLABLE()
- template<typename Pair>
- struct impl
+ template<typename Sig>
+ struct result;
+
+ template<typename This, typename Pair>
+ struct result<This(Pair)>
{
- typedef typename Pair::first_type result_type;
- result_type operator()(Pair const &pair) const
- {
- return pair.first;
- }
+ typedef typename Pair::first_type type;
};
- template<typename Pair>
- struct impl<Pair &>
+ template<typename This, typename Pair>
+ struct result<This(Pair &)>
{
- typedef typename Pair::first_type &result_type;
- result_type operator()(Pair &pair) const
- {
- return pair.first;
- }
+ typedef typename Pair::first_type &type;
};
- template<typename Pair>
- struct impl<Pair const &>
+ template<typename This, typename Pair>
+ struct result<This(Pair const &)>
{
- typedef typename Pair::first_type const &result_type;
- result_type operator()(Pair const &pair) const
- {
- return pair.first;
- }
+ typedef typename Pair::first_type const &type;
};
+
+ template<typename Pair>
+ typename Pair::first_type &operator()(Pair &pair) const
+ {
+ return pair.first;
+ }
+
+ template<typename Pair>
+ typename Pair::first_type const &operator()(Pair const &pair) const
+ {
+ return pair.first;
+ }
};
/// \brief A PolymorphicFunctionObject type that returns
@@ -94,39 +95,41 @@
/// A PolymorphicFunctionObject type that returns
/// the second element of a std::pair..
struct second
- : proto::detail::poly_function<second>
{
BOOST_PROTO_CALLABLE()
- template<typename Pair>
- struct impl
+ template<typename Sig>
+ struct result;
+
+ template<typename This, typename Pair>
+ struct result<This(Pair)>
{
- typedef typename Pair::second_type result_type;
- result_type operator()(Pair const &pair) const
- {
- return pair.second;
- }
+ typedef typename Pair::second_type type;
};
- template<typename Pair>
- struct impl<Pair &>
+ template<typename This, typename Pair>
+ struct result<This(Pair &)>
{
- typedef typename Pair::second_type &result_type;
- result_type operator()(Pair &pair) const
- {
- return pair.second;
- }
+ typedef typename Pair::second_type &type;
};
- template<typename Pair>
- struct impl<Pair const &>
+ template<typename This, typename Pair>
+ struct result<This(Pair const &)>
{
- typedef typename Pair::second_type const &result_type;
- result_type operator()(Pair const &pair) const
- {
- return pair.second;
- }
+ typedef typename Pair::second_type const &type;
};
+
+ template<typename Pair>
+ typename Pair::second_type &operator()(Pair &pair) const
+ {
+ return pair.second;
+ }
+
+ template<typename Pair>
+ typename Pair::second_type const &operator()(Pair const &pair) const
+ {
+ return pair.second;
+ }
};
}}}
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