cpp/utility/optional/operator cmp

Performs comparison operations on objects.

@1-7@ Compares two objects,  and. The contained values are compared (using the corresponding operator of ) only if both and  contain values. Otherwise,


 * is considered equal to if, and only if, both  and  do not contain a value.
 * is considered less than if, and only if,  contains a value and  does not.

@8-20@ Compares with a. Equivalent to when comparing to an  that does not contain a value.

@21-33@ Compares with a. The values are compared (using the corresponding operator of ) only if contains a value. Otherwise, is considered less than. If the corresponding two-way comparison expression between and  is not well-formed, or if its result is not convertible to, the program is ill-formed.

Return value
@1@ If, returns Otherwise, if (and so  as well), returns Otherwise, returns.

@2@ If, returns Otherwise, if (and so  as well), returns Otherwise, returns.

@3@ If returns Otherwise, if, returns Otherwise returns

@4@ If returns Otherwise, if, returns Otherwise returns

@5@ If returns Otherwise, if, returns Otherwise returns

@6@ If returns Otherwise, if, returns Otherwise returns

@7@ If is  returns Otherwise, returns

@8-9@ Returns. @10-11@ Returns. @12@ Returns. @13@ Returns. @14@ Returns. @15@ Returns. @16@ Returns. @17@ Returns. @18@ Returns. @19@ Returns. @20@ Returns.

@21@ Returns. @22@ Returns. @23@ Returns. @24@ Returns. @25@ Returns. @26@ Returns. @27@ Returns. @28@ Returns. @29@ Returns. @30@ Returns. @31@ Returns. @32@ Returns. @33@ Returns.

Exceptions
@1-7@ @21-33@ Throws when and what the comparison throws.