// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 3477. Simplify constraints for semiregular-box
- __box&
+ // 3572. copyable-box should be fully constexpr
+ constexpr __box&
operator=(const __box& __that)
noexcept(is_nothrow_copy_constructible_v<_Tp>)
requires (!copyable<_Tp>)
return *this;
}
- __box&
+ constexpr __box&
operator=(__box&& __that)
noexcept(is_nothrow_move_constructible_v<_Tp>)
requires (!movable<_Tp>)
static_assert(!requires { views::all | filter; });
}
+constexpr bool
+test07()
+{
+ struct Pred
+ {
+ constexpr Pred() { }
+ constexpr Pred(const Pred&) { }
+ constexpr Pred(Pred&&) { }
+ // These make it non-copyable, so non-copyable-box<Pred> will provide
+ // assignment.
+ Pred& operator=(const Pred&) = delete;
+ Pred& operator=(Pred&&) = delete;
+
+ bool operator()(int i) const { return i < 10; }
+ };
+
+ int i = 0;
+ ranges::filter_view v(views::single(i), Pred{});
+ // LWG 3572. copyable-box should be fully constexpr
+ v = v;
+ v = std::move(v);
+
+ return true;
+}
+
+static_assert( test07() );
+
int
main()
{
test05<forward_iterator_wrapper>();
test05<random_access_iterator_wrapper>();
test06();
+ test07();
}