Files
cppdraft_translate/cppdraft/optional/nullopt.md
2025-10-25 03:02:53 +03:00

1013 B

[optional.nullopt]

22 General utilities library [utilities]

22.5 Optional objects [optional]

22.5.5 No-value state indicator [optional.nullopt]

🔗

struct nullopt_t{see below}; inline constexpr nullopt_t nullopt(unspecified);

1

#

The struct nullopt_t is an empty class type used as a unique type to indicate the state of not containing a value for optional objects.

In particular, optional has a constructor with nullopt_t as a single argument; this indicates that an optional object not containing a value shall be constructed.

2

#

Type nullopt_t shall not have a default constructor or an initializer-list constructor, and shall not be an aggregate.