Home   Manual   Type Index   Symbol Index   Topics Index

std::if

classic if; can be used as a function or a procedure

Description

The first argument must be std::true or std::false.

The second argument represents the "then-part" and must be a function; it is called, if the first argument is std::true.

The third argument is optional represents the "else-part". if present it must be a function and is called, if the first argument is std::false.

The "then-part"- and "else-part" function can return any number of results (including none). But both (if then "else-part" is present) should return the same number of results.

See also

std::unless   executes a function unless the condition is true
std::default_value   returns the first argument if it is defined or else the second argument

Implemented by

std_types::false  as  std_types::false/std::if
std_types::true  as  std_types::true/std::if

Topics

Branches