Chris@16: // Boost.Range library Chris@16: // Chris@16: // Copyright Thorsten Ottosen 2003-2004. Use, modification and Chris@16: // distribution is subject to the Boost Software License, Version Chris@16: // 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // For more information, see http://www.boost.org/libs/range/ Chris@16: // Chris@16: Chris@16: #ifndef BOOST_RANGE_CONST_ITERATOR_HPP Chris@16: #define BOOST_RANGE_CONST_ITERATOR_HPP Chris@16: Chris@101: #if defined(_MSC_VER) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@16: Chris@101: #include Chris@16: #include Chris@16: #include Chris@101: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: ////////////////////////////////////////////////////////////////////////// Chris@16: // default Chris@16: ////////////////////////////////////////////////////////////////////////// Chris@16: Chris@101: namespace range_detail Chris@101: { Chris@16: Chris@101: BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( const_iterator ) Chris@16: Chris@101: template< typename C > Chris@101: struct range_const_iterator Chris@101: : extract_const_iterator Chris@101: {}; Chris@16: Chris@101: ////////////////////////////////////////////////////////////////////////// Chris@101: // pair Chris@101: ////////////////////////////////////////////////////////////////////////// Chris@101: Chris@101: template< typename Iterator > Chris@101: struct range_const_iterator > Chris@101: { Chris@101: typedef Iterator type; Chris@101: }; Chris@101: Chris@101: ////////////////////////////////////////////////////////////////////////// Chris@101: // array Chris@101: ////////////////////////////////////////////////////////////////////////// Chris@101: Chris@101: template< typename T, std::size_t sz > Chris@101: struct range_const_iterator< T[sz] > Chris@101: { Chris@101: typedef const T* type; Chris@101: }; Chris@101: Chris@101: } // namespace range_detail Chris@101: Chris@101: template Chris@101: struct range_const_iterator Chris@101: : range_detail::range_const_iterator< Chris@101: BOOST_DEDUCED_TYPENAME remove_reference::type Chris@101: > Chris@101: { Chris@101: }; Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: Chris@16: #endif