1 ///////////////////////////////////////////////////////////////////////////////
3 /// Proto callables for boost::rbegin()
5 // Copyright 2012 Eric Niebler. Distributed under the Boost
6 // Software License, Version 1.0. (See accompanying file
7 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_RBEGIN_HPP_EAN_27_08_2012
10 #define BOOST_PROTO_FUNCTIONAL_RANGE_RBEGIN_HPP_EAN_27_08_2012
12 #include <boost/range/rbegin.hpp>
13 #include <boost/proto/proto_fwd.hpp>
15 namespace boost { namespace proto { namespace functional
18 // A PolymorphicFunctionObject that wraps boost::rbegin()
21 BOOST_PROTO_CALLABLE()
23 template<typename Sig>
26 template<typename This, typename Rng>
27 struct result<This(Rng)>
28 : boost::range_reverse_iterator<Rng const>
31 template<typename This, typename Rng>
32 struct result<This(Rng &)>
33 : boost::range_reverse_iterator<Rng>
36 template<typename Rng>
37 typename boost::range_reverse_iterator<Rng>::type operator()(Rng &rng) const
39 return boost::rbegin(rng);
42 template<typename Rng>
43 typename boost::range_reverse_iterator<Rng const>::type operator()(Rng const &rng) const
45 return boost::rbegin(rng);