mirror of
https://github.com/boostorg/utility.git
synced 2025-07-30 21:07:27 +02:00
Update copyright notice; change to_string to avoid UB by calling a different constructor. Fixes #11150
This commit is contained in:
@ -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
|
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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -82,12 +82,12 @@ namespace boost {
|
|||||||
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
||||||
template<typename Allocator>
|
template<typename Allocator>
|
||||||
explicit operator std::basic_string<charT, traits, Allocator>() const {
|
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
|
#endif
|
||||||
|
|
||||||
std::basic_string<charT, traits> to_string () const {
|
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
|
// iterators
|
||||||
|
Reference in New Issue
Block a user