Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::nullopt_t

      From cppreference.com
      <cpp‎ |experimental‎ |optional
       
       
       
       
       
      Defined in header<experimental/optional>
      struct nullopt_t;
      (library fundamentals TS)

      std::experimental::nullopt_t is an empty class type used to indicateoptional type with uninitialized state. In particular,std::experimental::optional has a constructor withnullopt_t as a single argument, which creates an optional that does not contain a value.

      std::experimental::nullopt_t must be aLiteralType and cannot have a default constructor.

      It must have aconstexpr constructor that takes some implementation-defined literal type.

      [edit]Notes

      nullopt_t is notDefaultConstructible to support bothop={}; andop= nullopt; as the syntax for disengaging an optional object.

      A possible implementation of this class is

      struct nullopt_t{constexpr 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/experimental/optional/nullopt_t&oldid=155035"

      [8]ページ先頭

      ©2009-2026 Movatter.jp