Define an rvalue of type T and (if given) value VAL.
- Parameters
-
T | must be a type that can serve as an rvalue, but see below. |
VAL | can be omitted. If given it must be assignment compatible to T. If omitted, an rvalue of type T with default initialization is produced. |
In a way this is a "safer" cast operation. E.g
int a = 32;
g((double)a);
- Precondition
- T must be a type to which a value can be assigned. This excludes function types and array types. It does not exclude pointers to function types or array types, but unfortunately for syntactic reasons these two only work if T is a
typedef
to that pointer type.
- See also
- P99_AVAL for an array type with unknown base type.
-
P99_LVAL for a macro that returns an lvalue.
Definition at line 1121 of file p99_int.h.