Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::default_initializable

      From cppreference.com
      <cpp‎ |concepts
       
       
      Concepts library
       
      Defined in header<concepts>
      template<class T>

      concept default_initializable=std::constructible_from<T>&& requires{ T{};}&&

                                     /* T t; is well-formed, see below */;
      (since C++20)

      Thedefault_initializable concept checks whether variables of typeT can be

      Access checking is performed as if in a context unrelated to T. Only the validity of the immediate context of the variable initialization is considered.

      [edit]Possible implementation

      template<class T>concept default_initializable=std::constructible_from<T>&&    requires{ T{};::new T;};

      [edit]References

      • C++23 standard (ISO/IEC 14882:2024):
      • 18.4.12 Conceptdefault_initializable [concept.default.init]
      • C++20 standard (ISO/IEC 14882:2020):
      • 18.4.12 Conceptdefault_initializable [concept.default.init]

      [edit]See also

      specifies that a variable of the type can be constructed from or bound to a set of argument types
      (concept)[edit]
      checks if a type has a default constructor
      (class template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/concepts/default_initializable&oldid=177891"

      [8]ページ先頭

      ©2009-2025 Movatter.jp