Any++
Loading...
Searching...
No Matches
anyxx::unique Struct Reference

#include <anyxx.hpp>

Public Member Functions

 unique (mutable_void p=nullptr)
 unique (unique const &)=delete
unique & operator= (unique const &)=delete
 unique (unique &&other) noexcept
unique & operator= (unique &&other) noexcept
 operator bool () const

Public Attributes

mutable_void ptr = nullptr

Detailed Description

Proxy to manage the captured object via std::unique_ptr-like smart pointer

  • If you pass a std::unique_ptr to the any constructor, this pointer will be released and the ownership goes to the unique. NOTE: The any_v_table will build with the value_type of the std::unique_ptr.
  • If you pass an object as second parameter, with the std::in_place tag as first, this object will be moved to the memory managed by the unique.
  • If you pass as first parameter std::in_place_type<...>, the object will be constructed in place in the allocated memory with the other arguments forwarded.
Examples
21_Tree_any_borrow_as.cpp.

The documentation for this struct was generated from the following file: