X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=boost%2Frange%2Fdetail%2Fbegin.hpp;fp=boost%2Frange%2Fdetail%2Fbegin.hpp;h=f3da7323a4107089f6b92f117ca4a5ab50249047;hp=0000000000000000000000000000000000000000;hb=2d71eb92104693ca9baa5a2e1c23eeca776d8fd3;hpb=da57529b92adbb7ae74a89861cb39fb35ac7c62d diff --git a/boost/range/detail/begin.hpp b/boost/range/detail/begin.hpp new file mode 100644 index 0000000..f3da732 --- /dev/null +++ b/boost/range/detail/begin.hpp @@ -0,0 +1,94 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen 2003-2004. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_DETAIL_BEGIN_HPP +#define BOOST_RANGE_DETAIL_BEGIN_HPP + +#include // BOOST_MSVC +#include +#include +#include +#if BOOST_WORKAROUND(BOOST_MSVC, < 1310) +# include +#endif + +namespace boost +{ + + namespace range_detail + { + template< typename T > + struct range_begin; + + ////////////////////////////////////////////////////////////////////// + // default + ////////////////////////////////////////////////////////////////////// + + template<> + struct range_begin + { + template< typename C > + static BOOST_RANGE_DEDUCED_TYPENAME range_iterator::type fun( C& c ) + { + return c.begin(); + }; + }; + + ////////////////////////////////////////////////////////////////////// + // pair + ////////////////////////////////////////////////////////////////////// + + template<> + struct range_begin + { + template< typename P > + static BOOST_RANGE_DEDUCED_TYPENAME range_iterator

::type fun( const P& p ) + { + return p.first; + } + }; + + ////////////////////////////////////////////////////////////////////// + // array + ////////////////////////////////////////////////////////////////////// + + template<> + struct range_begin + { + #if !BOOST_WORKAROUND(BOOST_MSVC, < 1310) + template< typename T, std::size_t sz > + static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] ) + { + return boost_range_array; + } + #else + template + static BOOST_RANGE_DEDUCED_TYPENAME range_value::type* fun(T& t) + { + return t; + } + #endif + }; + + } // namespace 'range_detail' + + namespace range_adl_barrier + { + template< typename C > + inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator::type + begin( C& c ) + { + return range_detail::range_begin< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range::type >::fun( c ); + } + } +} // namespace 'boost' + + +#endif