C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Implementing a movable container for immovable objects: std::box<T>

From: Oskars Putans <o.putaans_at_[hidden]>
Date: Sun, 15 Dec 2024 00:15:02 +0200
Thank you for linking this.
While these are similar to what I wanted to do (dynamically-allocated
objects with value semantics), the motivation behind the proposal is very
different.
The main purpose for my proposal is to constrain unique pointers to ensure
maximum memory-safety and not make copies.
Feel free to correct me, but when, for example, moving Indirect objects, a
new allocation takes place and the values are moved. My proposed class is
moreso a smart pointer, which does not make
new allocations upon moving. My proposal should include that no allowed
operation apart from explicit reallocations like "emplace" change the
location of the content, allowing you to hold references to it while moving
the box itself around, similar to how unique_ptr operates.

sestd., 2024. g. 14. dec., plkst. 23:10 — lietotājs Ivan Matek (<
libbooze_at_[hidden]>) rakstīja:

> My suggestion is to also read:
> https://isocpp.org/files/papers/P3019R11.pdf
> /
> https://github.com/cplusplus/papers/issues/1680
> (please do not comment on github issue, it is for tracking, not discussion)
>
>
>>
>>

Received on 2024-12-14 22:15:17