@@ -78,20 +78,18 @@ void test_operator_new(typename Gen::promise_type& p, const Alloc2& alloc2 = {})
78
78
}
79
79
80
80
// Test 'operator new(size_t, allocator_arg_t, const Alloc2&, const Args&...)'
81
- constexpr bool has_op_new2 = HasOperatorNew<Promise, size_t , allocator_arg_t , const Alloc2&, int , int >;
82
- static_assert (has_op_new2 == (same_as<Alloc, void > || convertible_to<const Alloc2&, Alloc>) );
83
- if constexpr (has_op_new2) {
81
+ // This operator new is unconstrained.
82
+ if constexpr (same_as<Alloc, void > || convertible_to<const Alloc2&, Alloc>) {
84
83
const size_t size = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
85
84
void * const mem = p.operator new (size, allocator_arg, alloc2, 0 , 0 );
86
85
assert (reinterpret_cast <uintptr_t >(mem) % __STDCPP_DEFAULT_NEW_ALIGNMENT__ == 0 );
87
86
p.operator delete (mem, size);
88
87
}
89
88
90
89
// Test 'operator new(size_t, const This&, allocator_arg_t, const Alloc2&, const Args&...)'
90
+ // This operator new is unconstrained.
91
91
struct S {};
92
- constexpr bool has_op_new3 = HasOperatorNew<Promise, size_t , const S&, allocator_arg_t , const Alloc2&, int , int >;
93
- static_assert (has_op_new3 == (same_as<Alloc, void > || convertible_to<const Alloc2&, Alloc>) );
94
- if constexpr (has_op_new3) {
92
+ if constexpr (same_as<Alloc, void > || convertible_to<const Alloc2&, Alloc>) {
95
93
const size_t size = __STDCPP_DEFAULT_NEW_ALIGNMENT__;
96
94
const S s;
97
95
void * const mem = p.operator new (size, s, allocator_arg, alloc2, 0 , 0 );
0 commit comments