sl@0: // Boost.Range library sl@0: // sl@0: // Copyright Thorsten Ottosen 2003-2004. Use, modification and sl@0: // distribution is subject to the Boost Software License, Version sl@0: // 1.0. (See accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: // sl@0: // For more information, see http://www.boost.org/libs/range/ sl@0: // sl@0: sl@0: #ifndef BOOST_RANGE_ITERATOR_HPP sl@0: #define BOOST_RANGE_ITERATOR_HPP sl@0: sl@0: #if defined(_MSC_VER) && (_MSC_VER >= 1200) sl@0: # pragma once sl@0: #endif sl@0: sl@0: #include sl@0: sl@0: #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION sl@0: #include sl@0: #else sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: namespace boost sl@0: { sl@0: ////////////////////////////////////////////////////////////////////////// sl@0: // default sl@0: ////////////////////////////////////////////////////////////////////////// sl@0: sl@0: template< typename C > sl@0: struct range_iterator sl@0: { sl@0: typedef BOOST_DEDUCED_TYPENAME C::iterator type; sl@0: }; sl@0: sl@0: ////////////////////////////////////////////////////////////////////////// sl@0: // pair sl@0: ////////////////////////////////////////////////////////////////////////// sl@0: sl@0: template< typename Iterator > sl@0: struct range_iterator< std::pair > sl@0: { sl@0: typedef Iterator type; sl@0: }; sl@0: sl@0: template< typename Iterator > sl@0: struct range_iterator< const std::pair > sl@0: { sl@0: typedef Iterator type; sl@0: }; sl@0: sl@0: ////////////////////////////////////////////////////////////////////////// sl@0: // array sl@0: ////////////////////////////////////////////////////////////////////////// sl@0: sl@0: template< typename T, std::size_t sz > sl@0: struct range_iterator< T[sz] > sl@0: { sl@0: typedef T* type; sl@0: }; sl@0: sl@0: template< typename T, std::size_t sz > sl@0: struct range_iterator< const T[sz] > sl@0: { sl@0: typedef const T* type; sl@0: }; sl@0: sl@0: ////////////////////////////////////////////////////////////////////////// sl@0: // string sl@0: ////////////////////////////////////////////////////////////////////////// sl@0: sl@0: template<> sl@0: struct range_iterator< char* > sl@0: { sl@0: typedef char* type; sl@0: }; sl@0: sl@0: template<> sl@0: struct range_iterator< wchar_t* > sl@0: { sl@0: typedef wchar_t* type; sl@0: }; sl@0: sl@0: template<> sl@0: struct range_iterator< const char* > sl@0: { sl@0: typedef const char* type; sl@0: }; sl@0: sl@0: template<> sl@0: struct range_iterator< const wchar_t* > sl@0: { sl@0: typedef const wchar_t* type; sl@0: }; sl@0: sl@0: template<> sl@0: struct range_iterator< char* const > sl@0: { sl@0: typedef char* type; sl@0: }; sl@0: sl@0: template<> sl@0: struct range_iterator< wchar_t* const > sl@0: { sl@0: typedef wchar_t* type; sl@0: }; sl@0: sl@0: template<> sl@0: struct range_iterator< const char* const > sl@0: { sl@0: typedef const char* type; sl@0: }; sl@0: sl@0: template<> sl@0: struct range_iterator< const wchar_t* const > sl@0: { sl@0: typedef const wchar_t* type; sl@0: }; sl@0: sl@0: } // namespace boost sl@0: sl@0: #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION sl@0: sl@0: #endif