зеркало из https://github.com/microsoft/STL.git
Implement P2499R0: `string_view` Range Constructor Should Be `explicit` (#2947)
This commit is contained in:
Родитель
06e7769550
Коммит
6db1eb4489
|
@ -1260,7 +1260,7 @@ public:
|
|||
&& (!requires {
|
||||
typename remove_reference_t<_Range>::traits_type;
|
||||
} || same_as<typename remove_reference_t<_Range>::traits_type, _Traits>))
|
||||
constexpr basic_string_view(_Range&& _Rng) noexcept(
|
||||
constexpr explicit basic_string_view(_Range&& _Rng) noexcept(
|
||||
noexcept(_RANGES data(_Rng)) && noexcept(_RANGES size(_Rng))) // strengthened
|
||||
: _Mydata(_RANGES data(_Rng)), _Mysize(static_cast<size_t>(_RANGES size(_Rng))) {}
|
||||
// clang-format on
|
||||
|
|
|
@ -316,6 +316,7 @@
|
|||
// P2441R2 views::join_with
|
||||
// P2442R1 Windowing Range Adaptors: views::chunk, views::slide
|
||||
// P2443R1 views::chunk_by
|
||||
// P2499R0 string_view Range Constructor Should Be explicit
|
||||
// P2549R0 unexpected<E>::error()
|
||||
|
||||
// Parallel Algorithms Notes
|
||||
|
|
|
@ -66,6 +66,10 @@ std/utilities/format/format.formatter/format.parse.ctx/begin.pass.cpp FAIL
|
|||
std/utilities/format/format.formatter/format.parse.ctx/ctor.pass.cpp FAIL
|
||||
std/utilities/format/format.formatter/format.parse.ctx/end.pass.cpp FAIL
|
||||
|
||||
# libc++ doesn't yet implement P2499R0
|
||||
std/strings/string.view/string.view.cons/from_range.pass.cpp FAIL
|
||||
std/strings/string.view/string.view.deduct/range.pass.cpp FAIL
|
||||
|
||||
# libc++ doesn't correctly constrain the iterator_traits specialization for common_iterator (https://reviews.llvm.org/D117449)
|
||||
std/iterators/predef.iterators/iterators.common/iterator_traits.compile.pass.cpp FAIL
|
||||
|
||||
|
|
|
@ -66,6 +66,10 @@ utilities\format\format.formatter\format.parse.ctx\begin.pass.cpp
|
|||
utilities\format\format.formatter\format.parse.ctx\ctor.pass.cpp
|
||||
utilities\format\format.formatter\format.parse.ctx\end.pass.cpp
|
||||
|
||||
# libc++ doesn't yet implement P2499R0
|
||||
strings\string.view\string.view.cons\from_range.pass.cpp
|
||||
strings\string.view\string.view.deduct\range.pass.cpp
|
||||
|
||||
# libc++ doesn't correctly constrain the iterator_traits specialization for common_iterator (https://reviews.llvm.org/D117449)
|
||||
iterators\predef.iterators\iterators.common\iterator_traits.compile.pass.cpp
|
||||
|
||||
|
|
|
@ -352,7 +352,9 @@ constexpr bool test_case_range_constructor() {
|
|||
|
||||
// Also tests some of the constraints:
|
||||
static_assert(is_constructible_v<string_view, vector<char>>);
|
||||
static_assert(is_convertible_v<vector<char>, string_view>);
|
||||
|
||||
// P2499R0 string_view Range Constructor Should Be explicit
|
||||
static_assert(!is_convertible_v<vector<char>, string_view>);
|
||||
|
||||
static_assert(!is_constructible_v<string_view, deque<char>>); // not contiguous
|
||||
static_assert(!is_convertible_v<deque<char>, string_view>);
|
||||
|
|
Загрузка…
Ссылка в новой задаче