Chris@16: // Boost.Range library Chris@16: // Chris@16: // Copyright Neil Groves 2010. 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@101: // Acknowledgments: Chris@101: // Ticket #8341: Arno Schoedl - improved handling of has_range_iterator upon Chris@101: // use-cases where T was const. Chris@16: #ifndef BOOST_RANGE_HAS_ITERATOR_HPP_INCLUDED Chris@16: #define BOOST_RANGE_HAS_ITERATOR_HPP_INCLUDED Chris@16: Chris@16: #include Chris@101: #include Chris@16: #include Chris@16: #include Chris@101: #include Chris@16: #include Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: namespace range_detail Chris@16: { Chris@16: BOOST_MPL_HAS_XXX_TRAIT_DEF(type) Chris@16: Chris@16: template Chris@16: struct has_range_iterator_impl Chris@16: : boost::mpl::false_ Chris@16: { Chris@16: }; Chris@16: Chris@16: template Chris@101: struct has_range_iterator_impl< Chris@101: T, Chris@101: BOOST_DEDUCED_TYPENAME ::boost::enable_if< Chris@101: BOOST_DEDUCED_TYPENAME mpl::eval_if, Chris@101: has_type::type> >, Chris@101: has_type > Chris@101: >::type Chris@101: >::type Chris@101: > Chris@16: : boost::mpl::true_ Chris@16: { Chris@16: }; Chris@16: Chris@16: template Chris@16: struct has_range_const_iterator_impl Chris@16: : boost::mpl::false_ Chris@16: { Chris@16: }; Chris@16: Chris@16: template Chris@101: struct has_range_const_iterator_impl< Chris@101: T, Chris@101: BOOST_DEDUCED_TYPENAME ::boost::enable_if< Chris@101: has_type > Chris@101: >::type Chris@101: > Chris@16: : boost::mpl::true_ Chris@16: { Chris@16: }; Chris@16: Chris@16: } // namespace range_detail Chris@16: Chris@16: template Chris@16: struct has_range_iterator Chris@101: : range_detail::has_range_iterator_impl< Chris@101: BOOST_DEDUCED_TYPENAME remove_reference::type> Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct has_range_const_iterator Chris@101: : range_detail::has_range_const_iterator_impl< Chris@101: BOOST_DEDUCED_TYPENAME remove_reference::type> Chris@16: {}; Chris@16: } // namespace boost Chris@16: Chris@16: #endif // include guard Chris@16: