AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
aui::no_escape< T > Struct Template Reference

Does not allow escaping, allowing to accept lvalue ref, rvalue ref, shared_ptr and etc without overhead. More...

Detailed Description

template<typename T>
struct aui::no_escape< T >

Does not allow escaping, allowing to accept lvalue ref, rvalue ref, shared_ptr and etc without overhead.

   Promises that the contained object wouldn't be copied/moved outside of the function thus does not take
   responsibility of deleting the object. This allows to accept lvalue and rvalue references, pointers,
   unique_ptr and shared_ptr without ref counter modification.

   Intended to use in function arguments.

   Accepts lvalue ref, rvalue ref, ptr and shared_ptr. Does not accepts null.
Template Parameters
Tundecorated type
Examples
/github/workspace/aui.core/src/AUI/Common/AObject.h.

Public Member Functions

 no_escape (T &value)
 
 no_escape (T &&value)
 
 no_escape (T *value)
 
 no_escape (const _< T > &value)
 
 no_escape (const _unique< T > &value)
 
template<typename DerivedFromT , std::enable_if_t< std::is_base_of_v< T, DerivedFromT > &&!std::is_same_v< DerivedFromT, T >, bool > = true>
 no_escape (const _< DerivedFromT > &value)
 
template<typename DerivedFromT , std::enable_if_t< std::is_base_of_v< T, DerivedFromT > &&!std::is_same_v< DerivedFromT, T >, bool > = true>
 no_escape (const _unique< DerivedFromT > &value)
 
T * ptr () const noexcept
 
T * operator-> () const noexcept
 
T & operator* () const noexcept
 

#include <AUI/Traits/values.h>


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