Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81184 - trunk/boost/test/utils/basic_cstring
From: gennadiy.rozental_at_[hidden]
Date: 2012-11-04 22:16:13


Author: rogeeff
Date: 2012-11-04 22:16:12 EST (Sun, 04 Nov 2012)
New Revision: 81184
URL: http://svn.boost.org/trac/boost/changeset/81184

Log:
Fixes #7365
Text files modified:
   trunk/boost/test/utils/basic_cstring/basic_cstring.hpp | 24 ++++++++++++++----------
   1 files changed, 14 insertions(+), 10 deletions(-)

Modified: trunk/boost/test/utils/basic_cstring/basic_cstring.hpp
==============================================================================
--- trunk/boost/test/utils/basic_cstring/basic_cstring.hpp (original)
+++ trunk/boost/test/utils/basic_cstring/basic_cstring.hpp 2012-11-04 22:16:12 EST (Sun, 04 Nov 2012)
@@ -20,6 +20,9 @@
 #include <boost/test/utils/basic_cstring/basic_cstring_fwd.hpp>
 #include <boost/test/utils/basic_cstring/bcs_char_traits.hpp>
 
+// Boost
+#include <boost/type_traits/remove_cv.hpp>
+
 // STL
 #include <string>
 
@@ -44,6 +47,7 @@
     typedef typename ut_detail::bcs_char_traits<CharT>::std_string std_string;
 
     typedef CharT value_type;
+ typedef typename remove_cv<value_type>::type value_ret_type;
     typedef value_type* pointer;
     typedef value_type const* const_pointer;
     typedef value_type& reference;
@@ -74,8 +78,8 @@
     basic_cstring( pointer first, pointer last );
 
     // data access methods
- value_type operator[]( size_type index ) const;
- value_type at( size_type index ) const;
+ value_ret_type operator[]( size_type index ) const;
+ value_ret_type at( size_type index ) const;
 
     // size operators
     size_type size() const;
@@ -205,7 +209,7 @@
 //____________________________________________________________________________//
 
 template<typename CharT>
-inline typename basic_cstring<CharT>::value_type
+inline typename basic_cstring<CharT>::value_ret_type
 basic_cstring<CharT>::operator[]( size_type index ) const
 {
     return m_begin[index];
@@ -214,7 +218,7 @@
 //____________________________________________________________________________//
 
 template<typename CharT>
-inline typename basic_cstring<CharT>::value_type
+inline typename basic_cstring<CharT>::value_ret_type
 basic_cstring<CharT>::at( size_type index ) const
 {
     if( m_begin + index >= m_end )
@@ -682,12 +686,12 @@
 // ************************************************************************** //
 
 template<typename CharT>
-inline typename basic_cstring<CharT>::value_type
+inline typename basic_cstring<CharT>::value_ret_type
 first_char( basic_cstring<CharT> source )
 {
- typedef typename basic_cstring<CharT>::value_type string_value_type;
+ typedef typename basic_cstring<CharT>::value_ret_type res_type;
 
- return source.is_empty() ? static_cast<string_value_type>(0) : *source.begin();
+ return source.is_empty() ? static_cast<res_type>(0) : *source.begin();
 }
 
 //____________________________________________________________________________//
@@ -697,12 +701,12 @@
 // ************************************************************************** //
 
 template<typename CharT>
-inline typename basic_cstring<CharT>::value_type
+inline typename basic_cstring<CharT>::value_ret_type
 last_char( basic_cstring<CharT> source )
 {
- typedef typename basic_cstring<CharT>::value_type string_value_type;
+ typedef typename basic_cstring<CharT>::value_ret_type res_type;
 
- return source.is_empty() ? static_cast<string_value_type>(0) : *(source.end()-1);
+ return source.is_empty() ? static_cast<res_type>(0) : *(source.end()-1);
 }
 
 //____________________________________________________________________________//


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk