Add tests to ensure that string_view|ref from rvalue fails (whenever it can)

This commit is contained in:
Marshall Clow committed 2017-02-13 10:25:04 -08:00
1 parent 9960d9f395
commit 00f02167e3
5 files changed
+65 -8

No files matched your search

+6 -7
View File
@@ -91,15 +91,14 @@ namespace boost {
#endif
template<typename Allocator>
basic_string_view(const std::basic_string<charT, traits,
Allocator>& str) BOOST_NOEXCEPT
: ptr_(str.data()), len_(str.length()) {}
basic_string_view(const std::basic_string<charT, traits, Allocator>& str) BOOST_NOEXCEPT
: ptr_(str.data()), len_(str.length()) {}
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
// Constructing a string_view from a temporary string is a bad idea
template<typename Allocator>
basic_string_view(std::basic_string<charT, traits, Allocator>&& str)
= delete;
// Constructing a string_view from a temporary string is a bad idea
template<typename Allocator>
basic_string_view( std::basic_string<charT, traits, Allocator>&&)
= delete;
#endif
BOOST_CONSTEXPR basic_string_view(const charT* str)