cuda::experimental::stf::nullval#

struct nullval#

The bottom type: a type with no values, convertible to every type.

A callable that declares nullval as its return type promises in the type system that it never returns normally: keeping the promise any other way would require materializing a value of a type that has none. [[noreturn]] makes the same promise to the optimizer, but not reliably to overload resolution; a nullval result states it as a fact of the type, visible to metaprogramming and impossible to fake.

The conversion operator lets a nullval expression appear wherever a value of any type is expected, references included: a never-returning call may be returned from a function of any result type, or supply one arm of a ternary whose other arm produces the legitimate value. The operator can never run — running it would require an object that cannot exist — so its body exists to satisfy the compiler, not to execute.

Public Functions

nullval() = delete#
nullval(const nullval&) = delete#
nullval &operator=(const nullval&) = delete#