Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::nullopt_t

      From cppreference.com
      <cpp‎ |utility‎ |optional
       
       
      Utilities library
       
       
      Defined in header<optional>
      struct nullopt_t;
      (since C++17)

      std::nullopt_t is an empty class type used to indicate that anstd::optional does not contain a value.

      std::nullopt_t is a non-aggregateLiteralType that has no default constructor, no initializer-list constructor, but does have aconstexpr constructor that takes an implementation-defined literal type.

      [edit]Notes

      The constraints onnullopt_t's constructors exist to support bothop={}; andop= nullopt; as the syntax for disengaging an optional object.

      A possible implementation of this class is

      struct nullopt_t{constexprexplicit nullopt_t(int){}};

      [edit]See also

      (C++17)
      an object of typenullopt_t
      (constant)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/optional/nullopt_t&oldid=172375"

      [8]ページ先頭

      ©2009-2025 Movatter.jp