isRefCountedPayloadEnabled

Template to determine if hook defines that the Expected storage should use refcounted state storage.

If this is enabled, payload is mallocated on the heap and dealocated with the destruction of last $(Expected) instance.

See hasOnUnchecked handler, which can be used in combination with refcounted payload to enforce that the result is checked.

Members

Manifest constants

isRefCountedPayloadEnabled
enum isRefCountedPayloadEnabled;
Undocumented in source.
isRefCountedPayloadEnabled
enum isRefCountedPayloadEnabled;
Undocumented in source.

Examples

struct Foo {}
struct Bar {
    static immutable bool enableCopyConstructor = false;
    static immutable bool enableRefCountedPayload = true;
}
struct Hook { static immutable bool enableRefCountedPayload = true; }
static assert(!isRefCountedPayloadEnabled!Foo);
static assert(!__traits(compiles, isRefCountedPayloadEnabled!Bar));
static assert(isRefCountedPayloadEnabled!Hook);

Meta