Jonathan Wakely

Results 245 comments of Jonathan Wakely

The code as written is fine, I don't think making a final destructor virtual makes sense, and a suppression shouldn't be needed. Maybe the enforcement should say "Any **non-final** class...

This is consistent with what we've done for the `base()` members of iterator adaptors in C++20, to support move-only iterators. Should the `const&` one really return a reference though? My...

> C++17 has `destroy_at()` to facilitate this, but no good equivalent for in-place construction. C++20 is adding [uninitialized_construct_using_allocator](https://en.cppreference.com/w/cpp/memory/uninitialized_construct_using_allocator) as an alternative to a "naked placement new", but it doesn't solve...

> This is especially common in embedded systems, where we will pre-allocate memory pools and then construct objects from pool memory using placement new. That means you don't use `make_unique`,...

@phillipjohnston what do you mean "inside of that unique_ptr"? There's no memory allocation inside unique_ptr. It is constructed with a pointer, and it passes that pointer to a deleter when...

> Ideally, we'd just use `unique_ptr(new (buffer) type{});`, That would use `delete` and try to deallocate your buffer. As I said, you need a custom deleter. > but `new` would...

He asked "Where is this documented?" and I think it's been said a few times in the issue discussions here, e.g. https://github.com/isocpp/CppCoreGuidelines/issues/862#issuecomment-286203744 > the Guidelines are designed to apply to...

I'm not sure what you mean by "the standard allocator", but if you mean `std::allocator`, that's not what I'm talking about. `std::allocator_traits` is not `std::allocator`. But I think we're talking...

> If my understanding is correct, It is. > then should we expect future updates/clarifications regarding the relationship between the Concepts TS and C++20 Concepts, or perhaps an update to...

> Is this what the standard says? Yes. > I always understood that cstddef defines the types in the std namespace in addition to also in the global namespace. No....