/usr/include/boost/range/detail/size.hpp is in libboost1.55-dev 1.55.0+dfsg-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | // Boost.Range library
//
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/range/
//
#ifndef BOOST_RANGE_DETAIL_SIZE_HPP
#define BOOST_RANGE_DETAIL_SIZE_HPP
#include <boost/config.hpp> // BOOST_MSVC
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
# include <boost/range/detail/vc6/size.hpp>
#else
# include <boost/range/detail/implementation_help.hpp>
# include <boost/range/detail/size_type.hpp>
# include <boost/range/detail/common.hpp>
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
# include <boost/range/detail/remove_extent.hpp>
# endif
# include <iterator>
namespace boost
{
namespace range_detail
{
template< typename T >
struct range_size_;
//////////////////////////////////////////////////////////////////////
// default
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<std_container_>
{
template< typename C >
static BOOST_RANGE_DEDUCED_TYPENAME C::size_type fun( const C& c )
{
return c.size();
};
};
//////////////////////////////////////////////////////////////////////
// pair
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<std_pair_>
{
template< typename P >
static BOOST_RANGE_DEDUCED_TYPENAME range_size<P>::type
fun( const P& p )
{
return std::distance( p.first, p.second );
}
};
//////////////////////////////////////////////////////////////////////
// array
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<array_>
{
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
template< typename T, std::size_t sz >
static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] )
{
return sz;
}
#else
template<typename T>
static std::size_t fun(T& t)
{
return remove_extent<T>::size;
}
#endif
};
template<>
struct range_size_<char_array_>
{
template< typename T, std::size_t sz >
static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] )
{
return boost::range_detail::array_size( boost_range_array );
}
};
template<>
struct range_size_<wchar_t_array_>
{
template< typename T, std::size_t sz >
static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] )
{
return boost::range_detail::array_size( boost_range_array );
}
};
//////////////////////////////////////////////////////////////////////
// string
//////////////////////////////////////////////////////////////////////
template<>
struct range_size_<char_ptr_>
{
static std::size_t fun( const char* s )
{
return boost::range_detail::str_size( s );
}
};
template<>
struct range_size_<const_char_ptr_>
{
static std::size_t fun( const char* s )
{
return boost::range_detail::str_size( s );
}
};
template<>
struct range_size_<wchar_t_ptr_>
{
static std::size_t fun( const wchar_t* s )
{
return boost::range_detail::str_size( s );
}
};
template<>
struct range_size_<const_wchar_t_ptr_>
{
static std::size_t fun( const wchar_t* s )
{
return boost::range_detail::str_size( s );
}
};
} // namespace 'range_detail'
template< typename C >
BOOST_RANGE_DEDUCED_TYPENAME range_size<C>::type
size( const C& c )
{
return range_detail::range_size_< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
}
} // namespace 'boost'
# endif
#endif
|