We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6dbf0cb commit 7751e0eCopy full SHA for 7751e0e
rpp/box.h
@@ -53,6 +53,15 @@ struct Box {
53
}
54
55
56
+ template<typename... Args>
57
+ [[nodiscard]] static Box make(Args&&... args) noexcept {
58
+ Box ret;
59
+ auto data = A::template make<Storage<T>>();
60
+ new(data->data()) T{forward<Args>(args)...};
61
+ ret.data_ = reinterpret_cast<T*>(data);
62
+ return ret;
63
+ }
64
+
65
template<Scalar_Allocator R = P>
66
[[nodiscard]] Box<T, R> clone() const noexcept
67
requires(Clone<T> || Copy_Constructable<T>)
0 commit comments