Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Class representing wrapper of dynamically allocated object behaving like rvalue reference. More...
#include <ptr_value.hpp>
Public Member Functions | |
ptr_value (const T &value) | |
Constructor of the ptr_value from dynaically allocated object. The class will take ownerhip of the pointer. More... | |
ptr_value (T &&value) | |
Constructor of the ptr_value from dynaically allocated object. The class will take ownerhip of the pointer. More... | |
template<class U > | |
ptr_value (ptr_value< U > &&other) | |
User conversion constructor from ptr_value for type U where T is its predecessor. More... | |
ptr_value (const ptr_value &other) | |
Copy construction will clone the pointer referenced value in source instance to create new one for the constructed object. More... | |
ptr_value (ptr_value &&other) noexcept | |
Move construction will transfer ownership of the pointer from source instance to newly created one. More... | |
ptr_value & | operator= (const ptr_value &other) |
Copy assignment will clone the pointer referenced value in source instance to create new one for the constructed object. More... | |
ptr_value & | operator= (ptr_value &&other) noexcept |
~ptr_value () noexcept | |
Destructor will free the owned instance. More... | |
T * | operator-> () && |
Arrow operator to chain dereference. More... | |
T * | operator-> () & |
Arrow operator to chain dereference. More... | |
const T * | operator-> () const & |
Arrow operator to chain dereference. More... | |
operator T& () & | |
Allow automatic cast to const reference. More... | |
operator const T && () const & | |
Allow automatic cast to const rvalue reference which can be itself binded to const reference. More... | |
operator T&& () && | |
Allow automatic cast to rvalue reference which can be itself binded to const reference. More... | |
const T & | get () const |
Getter of the holded value. More... | |
Friends | |
template<class U > | |
class | ptr_value |
Class representing wrapper of dynamically allocated object behaving like rvalue reference.
The class takes ownership of the dynamically allocated object
the | type of value wrapped |
|
inlineexplicit |
Constructor of the ptr_value from dynaically allocated object. The class will take ownerhip of the pointer.
|
inlineexplicit |
Constructor of the ptr_value from dynaically allocated object. The class will take ownerhip of the pointer.
|
inline |
User conversion constructor from ptr_value for type U where T is its predecessor.
U | the subtype of T |
other | the other instance |
|
inline |
Copy construction will clone the pointer referenced value in source instance to create new one for the constructed object.
other | the other instance |
|
inlinenoexcept |
Move construction will transfer ownership of the pointer from source instance to newly created one.
other | the other instance |
|
inlinenoexcept |
Destructor will free the owned instance.
|
inline |
Getter of the holded value.
|
inline |
Allow automatic cast to const rvalue reference which can be itself binded to const reference.
The expected cast type const T & causes ambuguity in cast resolution, therefore a hack like this was found.
|
inline |
Allow automatic cast to const reference.
|
inline |
Allow automatic cast to rvalue reference which can be itself binded to const reference.
|
inline |
Arrow operator to chain dereference.
|
inline |
Arrow operator to chain dereference.
|
inline |
Arrow operator to chain dereference.
|
inline |
Copy assignment will clone the pointer referenced value in source instance to create new one for the constructed object.
other | the other instance |
|
inlinenoexcept |
Move | assignment will swap holded pointers between the two instances. |
other | the other instance. |