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

A contract that enforces non-nullable initialization. More...

#include <AUI/Traits/values.h>

Detailed Description

template<typename T>
struct aui::non_null< T >
Template Parameters
Twrapped pointer-like type

If initialized with a value that equals to nullptr, issues a runtime assertion failure.

If initialized with nullptr itself, throws a compile-time error.

void render(aui::non_null<_<AView>> view) {
    view->render();
}
render(someView); // ok
someView = nullptr;
render(someView); // assertion failure in runtime
render(nullptr); // compile-time error
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:215
A contract that enforces non-nullable initialization.
Definition values.h:153