isCopyConstructorEnabled

Template to determine if hook enables or disables copy constructor.

It is enabled by default.

See hasOnUnchecked handler, which can be used in combination with disabled copy constructor to enforce that the result is checked.

If copy constructor is disabled, it severely limits function chaining as Expected needs to be passed as rvalue in that case.
@safe
template isCopyConstructorEnabled (
Hook
) {
enum isCopyConstructorEnabled;
enum isCopyConstructorEnabled;
}

Examples

struct Foo {}
struct Bar { static immutable bool enableCopyConstructor = false; }
static assert(isCopyConstructorEnabled!Foo);
static assert(!isCopyConstructorEnabled!Bar);

Meta