Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:27

0001 ///////////////////////////////////////////////////////////////////////////////
0002 /// \file begin.hpp
0003 /// Proto callables for boost::begin()
0004 //
0005 //  Copyright 2012 Eric Niebler. Distributed under the Boost
0006 //  Software License, Version 1.0. (See accompanying file
0007 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_BEGIN_HPP_EAN_27_08_2012
0010 #define BOOST_PROTO_FUNCTIONAL_RANGE_BEGIN_HPP_EAN_27_08_2012
0011 
0012 #include <boost/range/begin.hpp>
0013 #include <boost/proto/proto_fwd.hpp>
0014 
0015 namespace boost { namespace proto { namespace functional
0016 {
0017 
0018     // A PolymorphicFunctionObject that wraps boost::begin()
0019     struct begin
0020     {
0021         BOOST_PROTO_CALLABLE()
0022 
0023         template<typename Sig>
0024         struct result;
0025 
0026         template<typename This, typename Rng>
0027         struct result<This(Rng)>
0028           : boost::range_iterator<Rng const>
0029         {};
0030 
0031         template<typename This, typename Rng>
0032         struct result<This(Rng &)>
0033           : boost::range_iterator<Rng>
0034         {};
0035 
0036         template<typename Rng>
0037         typename boost::range_iterator<Rng>::type operator()(Rng &rng) const
0038         {
0039             return boost::begin(rng);
0040         }
0041 
0042         template<typename Rng>
0043         typename boost::range_iterator<Rng const>::type operator()(Rng const &rng) const
0044         {
0045             return boost::begin(rng);
0046         }
0047     };
0048 
0049 }}}
0050 
0051 #endif