Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::allocator_arg,std::allocator_arg_t

      From cppreference.com
      <cpp‎ |memory
       
       
      Memory management library
      (exposition only*)
      Allocators
      Uninitialized memory algorithms
      Constrained uninitialized memory algorithms
      Memory resources
      Uninitialized storage(until C++20)
      (until C++20*)
      (until C++20*)
      Garbage collector support(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
       
      Defined in header<memory>
      struct allocator_arg_t{explicit allocator_arg_t()=default;};
      (1)(since C++11)
      constexprstd::allocator_arg_t allocator_arg{};
      (2)(since C++11)
      (inline since C++17)
      1)std::allocator_arg_t is an empty class type used to disambiguate the overloads of constructors and member functions of allocator-aware objects, includingstd::tuple,std::function,std::packaged_task,(until C++17) andstd::promise.
      2)std::allocator_arg is an instance of(1) that can be passed to the constructors and member functions of such permitted types.

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 2510C++11the default constructor was non-explicit, which could lead to ambiguitymade explicit

      [edit]See also

      checks if the specified type supports uses-allocator construction
      (class template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/memory/allocator_arg&oldid=173775"

      [8]ページ先頭

      ©2009-2025 Movatter.jp