Fix inconsistencies in range adaptor tests (#1393)

This commit is contained in:
Casey Carter 2020-10-29 01:04:18 -07:00 коммит произвёл GitHub
Родитель 8685c3558c
Коммит 374736a9cc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -121,10 +121,10 @@ constexpr bool test_one(Rng&& rng) {
static_assert(same_as<views::all_t<const remove_cvref_t<Rng>>, V>); static_assert(same_as<views::all_t<const remove_cvref_t<Rng>>, V>);
static_assert(same_as<decltype(views::all(move(as_const(rng)))), V>); static_assert(same_as<decltype(views::all(move(as_const(rng)))), V>);
static_assert(noexcept(views::all(as_const(rng))) == is_noexcept); static_assert(noexcept(views::all(move(as_const(rng)))) == is_noexcept);
static_assert(same_as<decltype(move(as_const(rng)) | views::all), V>); static_assert(same_as<decltype(move(as_const(rng)) | views::all), V>);
static_assert(noexcept(as_const(rng) | views::all) == is_noexcept); static_assert(noexcept(move(as_const(rng)) | views::all) == is_noexcept);
static_assert(same_as<decltype(move(as_const(rng)) | views::all | views::all | views::all), V>); static_assert(same_as<decltype(move(as_const(rng)) | views::all | views::all | views::all), V>);
static_assert(noexcept(move(as_const(rng)) | views::all | views::all | views::all) == is_noexcept); static_assert(noexcept(move(as_const(rng)) | views::all | views::all | views::all) == is_noexcept);

Просмотреть файл

@ -159,10 +159,10 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) {
constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V> && !is_subrange<V>; constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V> && !is_subrange<V>;
STATIC_ASSERT(same_as<decltype(views::drop(move(as_const(rng)), 4)), M>); STATIC_ASSERT(same_as<decltype(views::drop(move(as_const(rng)), 4)), M>);
STATIC_ASSERT(noexcept(views::drop(as_const(rng), 4)) == is_noexcept); STATIC_ASSERT(noexcept(views::drop(move(as_const(rng)), 4)) == is_noexcept);
STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | drop_four), M>); STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | drop_four), M>);
STATIC_ASSERT(noexcept(as_const(rng) | drop_four) == is_noexcept); STATIC_ASSERT(noexcept(move(as_const(rng)) | drop_four) == is_noexcept);
STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | pipeline), pipeline_t<const remove_reference_t<Rng>>>); STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | pipeline), pipeline_t<const remove_reference_t<Rng>>>);
STATIC_ASSERT(noexcept(move(as_const(rng)) | pipeline) == is_noexcept); STATIC_ASSERT(noexcept(move(as_const(rng)) | pipeline) == is_noexcept);

Просмотреть файл

@ -126,10 +126,10 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) {
constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V>; constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V>;
STATIC_ASSERT(same_as<decltype(views::filter(move(as_const(rng)), is_even)), F>); STATIC_ASSERT(same_as<decltype(views::filter(move(as_const(rng)), is_even)), F>);
STATIC_ASSERT(noexcept(views::filter(as_const(rng), is_even)) == is_noexcept); STATIC_ASSERT(noexcept(views::filter(move(as_const(rng)), is_even)) == is_noexcept);
STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | filter_even), F>); STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | filter_even), F>);
STATIC_ASSERT(noexcept(as_const(rng) | filter_even) == is_noexcept); STATIC_ASSERT(noexcept(move(as_const(rng)) | filter_even) == is_noexcept);
STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | pipeline), pipeline_t<const remove_reference_t<Rng>>>); STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | pipeline), pipeline_t<const remove_reference_t<Rng>>>);
STATIC_ASSERT(noexcept(move(as_const(rng)) | pipeline) == is_noexcept); STATIC_ASSERT(noexcept(move(as_const(rng)) | pipeline) == is_noexcept);

Просмотреть файл

@ -131,10 +131,10 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) {
constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V>; constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V>;
static_assert(same_as<decltype(views::reverse(move(as_const(rng)))), R>); static_assert(same_as<decltype(views::reverse(move(as_const(rng)))), R>);
static_assert(noexcept(views::reverse(as_const(rng))) == is_nothrow_copy_constructible_v<R>); static_assert(noexcept(views::reverse(move(as_const(rng)))) == is_nothrow_copy_constructible_v<R>);
static_assert(same_as<decltype(move(as_const(rng)) | views::reverse), R>); static_assert(same_as<decltype(move(as_const(rng)) | views::reverse), R>);
static_assert(noexcept(as_const(rng) | views::reverse) == is_nothrow_copy_constructible_v<R>); static_assert(noexcept(move(as_const(rng)) | views::reverse) == is_nothrow_copy_constructible_v<R>);
static_assert(same_as<decltype(move(as_const(rng)) | views::reverse | views::reverse | views::reverse), R>); static_assert(same_as<decltype(move(as_const(rng)) | views::reverse | views::reverse | views::reverse), R>);
static_assert(noexcept(move(as_const(rng)) | views::reverse | views::reverse | views::reverse) == is_noexcept); static_assert(noexcept(move(as_const(rng)) | views::reverse | views::reverse | views::reverse) == is_noexcept);

Просмотреть файл

@ -158,10 +158,10 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) {
constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V> && !is_subrange<V>; constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V> && !is_subrange<V>;
STATIC_ASSERT(same_as<decltype(views::take(move(as_const(rng)), 4)), M>); STATIC_ASSERT(same_as<decltype(views::take(move(as_const(rng)), 4)), M>);
STATIC_ASSERT(noexcept(views::take(as_const(rng), 4)) == is_noexcept); STATIC_ASSERT(noexcept(views::take(move(as_const(rng)), 4)) == is_noexcept);
STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | take_four), M>); STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | take_four), M>);
STATIC_ASSERT(noexcept(as_const(rng) | take_four) == is_noexcept); STATIC_ASSERT(noexcept(move(as_const(rng)) | take_four) == is_noexcept);
STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | pipeline), pipeline_t<const remove_reference_t<Rng>>>); STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | pipeline), pipeline_t<const remove_reference_t<Rng>>>);
STATIC_ASSERT(noexcept(move(as_const(rng)) | pipeline) == is_noexcept); STATIC_ASSERT(noexcept(move(as_const(rng)) | pipeline) == is_noexcept);

Просмотреть файл

@ -134,10 +134,10 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) {
constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V>; constexpr bool is_noexcept = is_nothrow_copy_constructible_v<V>;
STATIC_ASSERT(same_as<decltype(views::transform(move(as_const(rng)), add8)), TV>); STATIC_ASSERT(same_as<decltype(views::transform(move(as_const(rng)), add8)), TV>);
STATIC_ASSERT(noexcept(views::transform(as_const(rng), add8)) == is_noexcept); STATIC_ASSERT(noexcept(views::transform(move(as_const(rng)), add8)) == is_noexcept);
STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | transform_incr), TV>); STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | transform_incr), TV>);
STATIC_ASSERT(noexcept(as_const(rng) | transform_incr) == is_noexcept); STATIC_ASSERT(noexcept(move(as_const(rng)) | transform_incr) == is_noexcept);
STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | pipeline), pipeline_t<const remove_reference_t<Rng>>>); STATIC_ASSERT(same_as<decltype(move(as_const(rng)) | pipeline), pipeline_t<const remove_reference_t<Rng>>>);
STATIC_ASSERT(noexcept(move(as_const(rng)) | pipeline) == is_noexcept); STATIC_ASSERT(noexcept(move(as_const(rng)) | pipeline) == is_noexcept);