зеркало из https://github.com/microsoft/STL.git
Tests: Prepare for P2251 (trivially copyable `span`/`basic_string_view`) (#2015)
This commit is contained in:
Родитель
aaa5d08964
Коммит
934a39ec18
|
@ -79,8 +79,8 @@ static_assert(ranges::enable_borrowed_range<span<int>>);
|
|||
static_assert(ranges::enable_borrowed_range<span<int, 3>>);
|
||||
#endif // __cpp_lib_concepts
|
||||
|
||||
// For performance, our implementation provides an additional guarantee beyond the Standard
|
||||
// that span and its iterator types are trivially copyable.
|
||||
// We provide non-standard guarantees that span and its iterator types are trivially copyable;
|
||||
// P2251 may eventually standardize that guarantee for span itself.
|
||||
static_assert(is_trivially_copyable_v<span<int>>);
|
||||
static_assert(is_trivially_copyable_v<span<int>::iterator>);
|
||||
static_assert(is_trivially_copyable_v<span<int, 3>>);
|
||||
|
|
|
@ -67,6 +67,11 @@ const evil_conversion_to_string_view_lvalue_only convert_lvalue_only{};
|
|||
#pragma clang diagnostic pop
|
||||
#endif // __clang__
|
||||
|
||||
// We provide a non-standard guarantee that basic_string_view is trivially copyable;
|
||||
// P2251 may eventually standardize that guarantee.
|
||||
static_assert(is_trivially_copyable_v<string_view>);
|
||||
static_assert(is_trivially_copyable_v<wstring_view>);
|
||||
|
||||
// noexcept assertions:
|
||||
// (functions that explicitly throw have their throws tested and therefore have no static_asserts)
|
||||
static_assert(noexcept(string_view{}), "default constructor not noexcept");
|
||||
|
|
Загрузка…
Ссылка в новой задаче