cuda::experimental::stf::nullval#
-
struct nullval#
The bottom type: a type with no values, convertible to every type.
A callable that declares
nullvalas 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; anullvalresult states it as a fact of the type, visible to metaprogramming and impossible to fake.The conversion operator lets a
nullvalexpression appear wherever a value of any type is expected, references included: a never-returning call may bereturned 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.