#include <manually-drop.hh>
|
|
| ManuallyDrop (T &&t) |
| template<typename... Arg> |
| | ManuallyDrop (std::in_place_t, Arg &&... args) |
|
| ManuallyDrop (ManuallyDrop< T > &&other) |
| T & | get () |
|
T & | operator* () |
|
T * | operator-> () |
| T && | take () && |
| void | destroy () |
template<typename T>
class nix::ManuallyDrop< T >
Analogous to Rust's ManuallyDrop structure. Only is destroyed when you call destroy().
◆ ManuallyDrop()
template<typename T>
template<typename... Arg>
◆ destroy()
Destroy the value. Safe to call multiple times.
◆ get()
Gets a reference to the inner T
◆ take()
Takes the value out of this object and gives it to you. Must not already be destroyed.
Example:
ManuallyDrop<std::unique_ptr<int>> md{std::in_place_t{}, new int()};
ManuallyDrop<std::unique_ptr<int>> md2{std::move(md).take()};
The documentation for this class was generated from the following file: