3 // Copyright Thorsten Ottosen 2003-2004. Use, modification and
4 // distribution is subject to the Boost Software License, Version
5 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // For more information, see http://www.boost.org/libs/range/
11 #ifndef BOOST_RANGE_SIZE_TYPE_HPP
12 #define BOOST_RANGE_SIZE_TYPE_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
18 #include <boost/range/config.hpp>
19 #include <boost/range/difference_type.hpp>
20 #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
21 #include <boost/range/detail/size_type.hpp>
24 #include <boost/utility/enable_if.hpp>
25 #include <boost/type_traits/make_unsigned.hpp>
26 #include <boost/type_traits/remove_const.hpp>
35 //////////////////////////////////////////////////////////////////////////
37 //////////////////////////////////////////////////////////////////////////
43 struct yes_type { char dummy[2]; };
46 static yes_type test(BOOST_DEDUCED_TYPENAME C::size_type x);
48 template<typename C, typename Arg>
49 static no_type test(Arg x);
52 static const bool value = sizeof(test<T>(0)) == sizeof(yes_type);
55 template<typename C, typename Enabler=void>
58 typedef BOOST_DEDUCED_TYPENAME make_unsigned<
59 BOOST_DEDUCED_TYPENAME range_difference<C>::type
66 BOOST_DEDUCED_TYPENAME enable_if<has_size_type<C>, void>::type
69 typedef BOOST_DEDUCED_TYPENAME C::size_type type;
80 struct range_size<const T >
81 : detail::range_size<T>
86 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION