cpp/utility/optional/transform

If contains a value, invokes  with the contained value as an argument, and returns an  that contains the result of that invocation; otherwise, returns an empty.

The type of contained value in the result (denoted by below) must be a non-array object type, and must not be std or std). Otherwise, the program is ill-formed.

@1@ Let be. If contains a value, returns a  whose contained value is direct-initialized from  (unlike, which must return an std directly). Otherwise, returns an empty. The program is ill-formed if the variable definition is ill-formed.

@2@ Same as, except that is.

@3@ Let be. If contains a value, returns a  whose contained value is direct-initialized from. Otherwise, returns an empty. The program is ill-formed if the variable definition is ill-formed.

@4@ Same as, except that is.

Return value
An std containing the result of or an empty std, as described above.