lucid  0.0.1
Lifting-based Uncertain Control Invariant Dynamics
Loading...
Searching...
No Matches
lucid::SelfReferenceCounter Concept Reference

Check if the type T is a self-reference counter type. More...

#include <concept.h>

Concept definition

template<class T>
concept lucid::SelfReferenceCounter = requires(T t) {
{ t.AddRef() };
{ t.Release() };
}
Check if the type T is a self-reference counter type.
Definition concept.h:60

Detailed Description

Check if the type T is a self-reference counter type.

A self-reference counter type must have both the AddRef and Release methods. The AddRef method should increment the internal reference counter. The Release method should decrement it, and if it reaches zero, the object should be deleted using its destructor.

template <SelfReferenceCounter T>
void foo(T t); // T can be any self-reference counter type
Template Parameters
Ttype to check