Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C++ named requirements:EmplaceConstructible(since C++11)

      From cppreference.com
      <cpp‎ |named req
       
       
      C++ named requirements
       

      Specifies that an object of the type can be constructed from a given set of arguments in uninitialized storage by a given allocator.

      [edit]Requirements

      The typeT isEmplaceConstructible into theContainerX (whosevalue_type is identical toT) from the argumentsargs if, given

      A an allocator type
      m an lvalue of typeA
      p the pointer of typeT* prepared by the container
      args zero or more arguments

      whereX::allocator_type is identical tostd::allocator_traits<A>::rebind_alloc<T>,

      the following expression is well-formed:

      std::allocator_traits<A>::construct(m, p, args);

      IfX is not allocator-aware or is astd::basic_string specialization, the term is defined as ifA werestd::allocator<T>, except that no allocator object needs to be created, and user-defined specializations ofstd::allocator are not instantiated.

      [edit]Notes

      Although it is required that customizedconstruct is used when constructing elements ofstd::basic_string until C++23, all implementations only used the default mechanism. The requirement is corrected byP1072R10 to match existing practice.

      [edit]See also

      CopyInsertable
      MoveInsertable
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/named_req/EmplaceConstructible&oldid=134913"

      [8]ページ先頭

      ©2009-2026 Movatter.jp