File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
tests/std/tests/P2321R2_views_adjacent_transform Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -9614,7 +9614,7 @@ namespace ranges {
9614
9614
: _Func(in_place, _STD move(_Func_)), _Inner(_STD move(_Range_)) {}
9615
9615
9616
9616
_NODISCARD constexpr _Vw base() const& noexcept(noexcept(_Inner.base())) // strengthened
9617
- requires copy_constructible<_Inner_view >
9617
+ requires copy_constructible<_Vw >
9618
9618
{
9619
9619
return _Inner.base();
9620
9620
}
Original file line number Diff line number Diff line change 5
5
#include < array>
6
6
#include < cassert>
7
7
#include < forward_list>
8
+ #include < functional>
8
9
#include < ranges>
9
10
#include < span>
10
11
#include < tuple>
@@ -968,6 +969,23 @@ int main() {
968
969
test_one<3 >(span<const int >{}, to_float, span<float >{});
969
970
}
970
971
972
+ { // LWG-3947 Unexpected constraints on adjacent_transform_view::base()
973
+ struct weird_span : span<int >, ranges::view_base {
974
+ weird_span () = default ;
975
+ weird_span (const weird_span&) = default ;
976
+ weird_span (weird_span&) = delete ;
977
+
978
+ weird_span& operator =(const weird_span&) = default ;
979
+ };
980
+ STATIC_ASSERT (!copy_constructible<weird_span>);
981
+
982
+ using weird_adjacent_transform_view = ranges::adjacent_transform_view<weird_span, ranges::equal_to, 2 >;
983
+ STATIC_ASSERT (!CanMemberBase<weird_adjacent_transform_view&>);
984
+ STATIC_ASSERT (!CanMemberBase<const weird_adjacent_transform_view&>);
985
+ STATIC_ASSERT (!CanMemberBase<const weird_adjacent_transform_view>);
986
+ STATIC_ASSERT (CanMemberBase<weird_adjacent_transform_view>);
987
+ }
988
+
971
989
STATIC_ASSERT ((instantiation_test (), true ));
972
990
instantiation_test ();
973
991
}
You can’t perform that action at this time.
0 commit comments