Enum member isExactConvertible

Whether every possible From value is exactly representable in To under the v0.2 exact raster conversion policy.

enum isExactConvertible(From, To) = false;

This is a universal type relation, not a runtime value test.

Exact integer conversion requires complete source-range containment.

Exact integer-to-floating conversion requires the entire integer domain to fit within the destination significand precision.

Exact floating conversion currently permits identity and float -> double.

Floating -> integer and double -> float are not universally exact.

Both From and To must satisfy isNumericRasterSample.

Example

Example checking semantic sample capabilities.

import raster;

static assert(isNumericRasterSample!float);
static assert(!isNumericRasterSample!real);
static assert(!isNumericRasterSample!(ubyte[4]));

static assert(isExactConvertible!(ubyte, float));
static assert(isExactConvertible!(float, double));
static assert(!isExactConvertible!(double, float));