contextually_convertible_to_bool

contextually convertible to bool - implies, for a given expression E, that E may be used to direct-initialize — e.g., bool b(E); — a bool variable, where even an explicit conversion operator (see Section 1.1.“explicit Operators” on page 61) to bool may be used, in contrast to implicit conversion, for which converting constructors and conversion operators that are declared as explicit are always excluded. Contextual conversion occurs when the core language must test an expression as bool, such as is required by an if or while statement, the condition of a ternary operator (?:), or a conditional noexcept specifier (see Section 3.1.“noexcept Specifier” on page 1085). See also contextual convertibility to bool. noexcept Specifier (1129)” (EMCppSfe 2021)

contextually_convertible_to_bool.txt · Last modified: 2024/04/28 03:34 (external edit)