Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:53:54

0001 // Copyright David Abrahams 2003. Use, modification and distribution is
0002 // subject to the Boost Software License, Version 1.0. (See accompanying
0003 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0004 #ifndef IS_READABLE_ITERATOR_DWA2003112_HPP
0005 #define IS_READABLE_ITERATOR_DWA2003112_HPP
0006 
0007 #include <iterator>
0008 #include <type_traits>
0009 
0010 namespace boost {
0011 namespace iterators {
0012 namespace detail {
0013 
0014 // Guts of is_readable_iterator.  It is the iterator type and
0015 // Value is the iterator's value_type.
0016 template< typename It, typename Value >
0017 struct is_readable_iterator_impl :
0018     public std::is_convertible<
0019         decltype(*std::declval< It& >()),
0020         typename std::add_lvalue_reference< Value >::type
0021     >
0022 {
0023 };
0024 
0025 //
0026 // void specializations to handle std input and output iterators
0027 //
0028 template< typename It >
0029 struct is_readable_iterator_impl< It, void > :
0030     public std::false_type
0031 {
0032 };
0033 
0034 template< typename It >
0035 struct is_readable_iterator_impl< It, const void > :
0036     public std::false_type
0037 {
0038 };
0039 
0040 template< typename It >
0041 struct is_readable_iterator_impl< It, volatile void > :
0042     public std::false_type
0043 {
0044 };
0045 
0046 template< typename It >
0047 struct is_readable_iterator_impl< It, const volatile void > :
0048     public std::false_type
0049 {
0050 };
0051 
0052 } // namespace detail
0053 
0054 template< typename T >
0055 struct is_readable_iterator :
0056     public iterators::detail::is_readable_iterator_impl<
0057         T,
0058         typename std::iterator_traits< T >::value_type const
0059     >::type
0060 {
0061 };
0062 
0063 } // namespace iterators
0064 
0065 using iterators::is_readable_iterator;
0066 
0067 } // namespace boost
0068 
0069 #endif // IS_READABLE_ITERATOR_DWA2003112_HPP