hasBitOps

Evaluates to true if either:

  • isScalarType!T, or
  • isCheckedInt!T

And bitwise operators such as << and ~ are available for T.

template hasBitOps (
T
) {
enum hasBitOps;
enum hasBitOps;
}

Examples

1 import checkedint.throws : SmartInt, SafeInt; // use IntFlagPolicy.throws
2 
3 assert( hasBitOps!(SafeInt!(int, Yes.bitOps)));
4 assert( hasBitOps!(SmartInt!(int, Yes.bitOps)));
5 assert( hasBitOps!int);
6 assert( hasBitOps!bool);
7 assert( hasBitOps!dchar);
8 
9 assert(!hasBitOps!(SafeInt!(int, No.bitOps)));
10 assert(!hasBitOps!(SmartInt!(int, No.bitOps)));
11 assert(!hasBitOps!float);

Meta