Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update copyright notice; change to_string to avoid UB by calling a di…
…fferent constructor. Fixes #11150
  • Loading branch information
mclow committed Mar 28, 2015
1 parent 6bcf4f9 commit 13610ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/boost/utility/string_ref.hpp
@@ -1,5 +1,5 @@
/*
Copyright (c) Marshall Clow 2012-2012.
Copyright (c) Marshall Clow 2012-2015.
Distributed under 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)
Expand Down Expand Up @@ -82,12 +82,12 @@ namespace boost {
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
template<typename Allocator>
explicit operator std::basic_string<charT, traits, Allocator>() const {
return std::basic_string<charT, traits, Allocator> ( ptr_, len_ );
return std::basic_string<charT, traits, Allocator> ( begin(), end());
}
#endif

std::basic_string<charT, traits> to_string () const {
return std::basic_string<charT, traits> ( ptr_, len_ );
return std::basic_string<charT, traits> ( begin(), end());
}

// iterators
Expand Down

0 comments on commit 13610ca

Please sign in to comment.