begin.hpp

来自「CGAL is a collaborative effort of severa」· HPP 代码 · 共 121 行

HPP
121
字号
// 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/range/result_iterator.hpp>#include <boost/range/detail/common.hpp>namespace boost {        namespace range_detail    {        template< typename T >        struct range_begin;        //////////////////////////////////////////////////////////////////////        // default        //////////////////////////////////////////////////////////////////////                template<>        struct range_begin<std_container_>        {            template< typename C >            static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<C>::type fun( C& c )            {                return c.begin();            };        };                            //////////////////////////////////////////////////////////////////////        // pair        //////////////////////////////////////////////////////////////////////                template<>        struct range_begin<std_pair_>        {            template< typename P >            static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<P>::type fun( const P& p )            {                return p.first;            }        };         //////////////////////////////////////////////////////////////////////        // array        //////////////////////////////////////////////////////////////////////                template<>        struct range_begin<array_>        {            template< typename T, std::size_t sz >            static T* fun( T BOOST_ARRAY_REF[sz] )            {                return array;            }        };        //////////////////////////////////////////////////////////////////////        // string        //////////////////////////////////////////////////////////////////////             template<>        struct range_begin<char_ptr_>        {            static char* fun( char* s )            {                return s;            }        };        template<>        struct range_begin<const_char_ptr_>        {            static const char* fun( const char* s )            {                return s;            }        };                template<>        struct range_begin<wchar_t_ptr_>        {                        static wchar_t* fun( wchar_t* s )            {                return s;            }        };        template<>        struct range_begin<const_wchar_t_ptr_>        {            static const wchar_t* fun( const wchar_t* s )            {                return s;            }        };    } // namespace 'range_detail'        template< typename C >    inline BOOST_DEDUCED_TYPENAME range_result_iterator<C>::type     begin( C& c )    {        return range_detail::range_begin< BOOST_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );    }    } // namespace 'boost'#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?