From 6c4ab93573904f6d37f74c8819ac39cd230118e9 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 28 Mar 2017 15:17:09 +0200 Subject: [PATCH] Revert change disallowing construction of string_view/string_ref from rvalue string --- include/boost/utility/string_ref.hpp | 12 ++++++------ include/boost/utility/string_view.hpp | 12 ++++++------ test/Jamfile.v2 | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/boost/utility/string_ref.hpp b/include/boost/utility/string_ref.hpp index 96ab439..6a8ce39 100644 --- a/include/boost/utility/string_ref.hpp +++ b/include/boost/utility/string_ref.hpp @@ -92,12 +92,12 @@ namespace boost { basic_string_ref(const std::basic_string& str) : ptr_(str.data()), len_(str.length()) {} -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) - // Constructing a string_ref from a temporary string is a bad idea - template - basic_string_ref( std::basic_string&&) - = delete; -#endif +// #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) +// // Constructing a string_ref from a temporary string is a bad idea +// template +// basic_string_ref( std::basic_string&&) +// = delete; +// #endif BOOST_CONSTEXPR basic_string_ref(const charT* str, size_type len) BOOST_NOEXCEPT : ptr_(str), len_(len) {} diff --git a/include/boost/utility/string_view.hpp b/include/boost/utility/string_view.hpp index c48a515..bb98ce3 100644 --- a/include/boost/utility/string_view.hpp +++ b/include/boost/utility/string_view.hpp @@ -94,12 +94,12 @@ namespace boost { basic_string_view(const std::basic_string& 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 - basic_string_view( std::basic_string&&) - = delete; -#endif +// #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 +// basic_string_view( std::basic_string&&) +// = delete; +// #endif BOOST_CONSTEXPR basic_string_view(const charT* str) : ptr_(str), len_(traits::length(str)) {} diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index f211b62..0150837 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -27,11 +27,11 @@ test-suite utility [ run ../operators_test.cpp ../../test/build//boost_test_exec_monitor/static ] [ compile result_of_test.cpp ] [ run ../shared_iterator_test.cpp ] - [ compile-fail string_ref_from_rvalue.cpp ] +# [ compile-fail string_ref_from_rvalue.cpp ] [ run string_ref_test1.cpp unit_test_framework ] [ run string_ref_test2.cpp unit_test_framework ] [ run string_ref_test_io.cpp unit_test_framework ] - [ compile-fail string_view_from_rvalue.cpp ] +# [ compile-fail string_view_from_rvalue.cpp ] [ run string_view_test1.cpp unit_test_framework ] [ run string_view_test2.cpp unit_test_framework ] [ run string_view_test_io.cpp unit_test_framework ]