implementation_help.hpp
Go to the documentation of this file.
1 // Boost.Range library
2 //
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)
7 //
8 // For more information, see http://www.boost.org/libs/range/
9 //
10 
11 #ifndef BOOST_RANGE_DETAIL_IMPLEMENTATION_HELP_HPP
12 #define BOOST_RANGE_DETAIL_IMPLEMENTATION_HELP_HPP
13 
14 #include <boost/range/config.hpp>
17 #include <cstddef>
18 #include <string.h>
19 
20 #ifndef BOOST_NO_CWCHAR
21 #include <wchar.h>
22 #endif
23 
24 namespace boost
25 {
26  namespace range_detail
27  {
28  template <typename T>
29  inline void boost_range_silence_warning( const T& ) { }
30 
32  // end() help
34 
35  inline const char* str_end( const char* s, const char* )
36  {
37  return s + strlen( s );
38  }
39 
40 #ifndef BOOST_NO_CWCHAR
41  inline const wchar_t* str_end( const wchar_t* s, const wchar_t* )
42  {
43  return s + wcslen( s );
44  }
45 #else
46  inline const wchar_t* str_end( const wchar_t* s, const wchar_t* )
47  {
48  if( s == 0 || s[0] == 0 )
49  return s;
50  while( *++s != 0 )
51  ;
52  return s;
53  }
54 #endif
55 
56  template< class Char >
57  inline Char* str_end( Char* s )
58  {
59  return const_cast<Char*>( str_end( s, s ) );
60  }
61 
62  template< class T, std::size_t sz >
64  {
65  return boost_range_array + sz;
66  }
67 
68  template< class T, std::size_t sz >
69  inline const T* array_end( const T BOOST_RANGE_ARRAY_REF()[sz] )
70  {
71  return boost_range_array + sz;
72  }
73 
75  // size() help
77 
78  template< class Char >
79  inline std::size_t str_size( const Char* const& s )
80  {
81  return str_end( s ) - s;
82  }
83 
84  template< class T, std::size_t sz >
85  inline std::size_t array_size( T BOOST_RANGE_ARRAY_REF()[sz] )
86  {
87  boost_range_silence_warning( boost_range_array );
88  return sz;
89  }
90 
91  template< class T, std::size_t sz >
92  inline std::size_t array_size( const T BOOST_RANGE_ARRAY_REF()[sz] )
93  {
94  boost_range_silence_warning( boost_range_array );
95  return sz;
96  }
97 
98  inline bool is_same_address(const void* l, const void* r)
99  {
100  return l == r;
101  }
102 
103  template<class T1, class T2>
104  inline bool is_same_object(const T1& l, const T2& r)
105  {
106  return range_detail::is_same_address(&l, &r);
107  }
108 
109  } // namespace 'range_detail'
110 
111 } // namespace 'boost'
112 
113 
114 #endif
boost::range_detail::is_same_address
bool is_same_address(const void *l, const void *r)
Definition: implementation_help.hpp:98
T
T
Definition: mem_fn_cc.hpp:25
boost::range_detail::str_size
std::size_t str_size(const Char *const &s)
Definition: implementation_help.hpp:79
s
XmlRpcServer s
common.hpp
boost::range_detail::str_end
const char * str_end(const char *s, const char *)
Definition: implementation_help.hpp:35
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::range_detail::array_end
T * array_end(T BOOST_RANGE_ARRAY_REF()[sz])
Definition: implementation_help.hpp:63
boost::range_detail::array_size
std::size_t array_size(T BOOST_RANGE_ARRAY_REF()[sz])
Definition: implementation_help.hpp:85
is_same.hpp
boost::range_detail::boost_range_silence_warning
void boost_range_silence_warning(const T &)
Definition: implementation_help.hpp:29
BOOST_RANGE_ARRAY_REF
#define BOOST_RANGE_ARRAY_REF()
Definition: range/config.hpp:44
config.hpp
boost::range_detail::is_same_object
bool is_same_object(const T1 &l, const T2 &r)
Definition: implementation_help.hpp:104


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:39:49