Update contrib.
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_DETAIL_EMPTY_HPP
12 #define BOOST_RANGE_DETAIL_EMPTY_HPP
14 #include <boost/range/detail/common.hpp>
18 namespace range_detail
20 template< typename T >
23 //////////////////////////////////////////////////////////////////////
25 //////////////////////////////////////////////////////////////////////
28 struct range_empty<std_container_>
30 template< typename C >
31 static bool fun( C& c )
37 //////////////////////////////////////////////////////////////////////
39 //////////////////////////////////////////////////////////////////////
42 struct range_empty<std_pair_>
44 template< typename P >
45 static bool fun( const P& p )
47 return p.first == p.second;
51 //////////////////////////////////////////////////////////////////////
53 //////////////////////////////////////////////////////////////////////
56 struct range_empty<array_>
58 template< typename T, std::size_t sz >
59 static bool fun( T BOOST_ARRAY_REF[sz] )
61 if( boost_range_array == 0 )
67 //////////////////////////////////////////////////////////////////////
69 //////////////////////////////////////////////////////////////////////
72 struct range_empty<char_ptr_>
74 static bool fun( const char* s )
76 return s == 0 || s[0] == 0;
81 struct range_empty<const_char_ptr_>
83 static bool fun( const char* s )
85 return s == 0 || s[0] == 0;
90 struct range_empty<wchar_t_ptr_>
92 static bool fun( const wchar_t* s )
94 return s == 0 || s[0] == 0;
99 struct range_empty<const_wchar_t_ptr_>
101 static bool fun( const wchar_t* s )
103 return s == 0 || s[0] == 0;
107 } // namespace 'range_detail'
110 template< typename C >
114 return range_detail::range_empty< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
117 } // namespace 'boost'