AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
aui::no_escape< T > Struct Template Reference

A funcntion contract that does not allow escaping, allowing to accept lvalue ref, rvalue ref, shared_ptr and etc without overhead. More...

#include <AUI/Traits/values.h>

Detailed Description

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

Promises that the contained object wouldn't be copied/moved/referenced outside the function where the no_escape came to; thus does not take responsibility of deleting the object. This allows to accept any kind of lifetimes: 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
examples/7guis/cells/src/Tokens.cpp, and examples/7guis/cells/src/Tokens.h.