MCRO
C++23 utilities for Unreal Engine.
|
#include <Badge.h>
Use this template to give exclusive access to functions to specific classes, like so: class A; class B; class C;
class A { static void CallFromB(TBadge<B> badge) {...} };
class B { void Foobar() { // OK A::CallFromB({}); } };
class C { void Foobar() { // compile error: // badge template instance declared in A::CallFromB is only friends with class B, // therefore the private default constructor is inaccessible from class C A::CallFromB({}); } };