Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:38:52

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_LVALUE_ITERATOR_DWA2003112_HPP
0005 #define IS_LVALUE_ITERATOR_DWA2003112_HPP
0006 
0007 #include <boost/iterator/detail/type_traits/conjunction.hpp>
0008 
0009 #include <iterator>
0010 #include <type_traits>
0011 
0012 namespace boost {
0013 namespace iterators {
0014 namespace detail {
0015 
0016 // Guts of is_lvalue_iterator.  It is the iterator type and
0017 // Value is the iterator's value_type.
0018 template< typename It, typename Value >
0019 struct is_lvalue_iterator_impl :
0020     public detail::conjunction<
0021         std::is_convertible< decltype(*std::declval< It& >()), typename std::add_lvalue_reference< Value >::type >,
0022         std::is_lvalue_reference< decltype(*std::declval< It& >()) >
0023     >::type
0024 {
0025 };
0026 
0027 //
0028 // void specializations to handle std input and output iterators
0029 //
0030 template< typename It >
0031 struct is_lvalue_iterator_impl< It, void > :
0032     public std::false_type
0033 {
0034 };
0035 
0036 template< typename It >
0037 struct is_lvalue_iterator_impl< It, const void > :
0038     public std::false_type
0039 {
0040 };
0041 
0042 template< typename It >
0043 struct is_lvalue_iterator_impl< It, volatile void > :
0044     public std::false_type
0045 {
0046 };
0047 
0048 template< typename It >
0049 struct is_lvalue_iterator_impl< It, const volatile void > :
0050     public std::false_type
0051 {
0052 };
0053 
0054 } // namespace detail
0055 
0056 template< typename T >
0057 struct is_lvalue_iterator :
0058     public iterators::detail::is_lvalue_iterator_impl<
0059         T,
0060         typename std::iterator_traits< T >::value_type const
0061     >::type
0062 {
0063 };
0064 
0065 template< typename T >
0066 struct is_non_const_lvalue_iterator :
0067     public iterators::detail::is_lvalue_iterator_impl<
0068         T,
0069         typename std::iterator_traits< T >::value_type
0070     >::type
0071 {
0072 };
0073 
0074 } // namespace iterators
0075 
0076 using iterators::is_lvalue_iterator;
0077 using iterators::is_non_const_lvalue_iterator;
0078 
0079 } // namespace boost
0080 
0081 #endif // IS_LVALUE_ITERATOR_DWA2003112_HPP