Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::uses_allocator<std::function>

      From cppreference.com
      <cpp‎ |utility‎ |functional‎ |function
       
       
      Utilities library
       
      Function objects
      Function invocation
      (C++17)(C++23)
      Identity function object
      (C++20)
      Old binders and adaptors
      (until C++17*)
      (until C++17*)
      (until C++17*)
      (until C++17*)  
      (until C++17*)
      (until C++17*)(until C++17*)(until C++17*)(until C++17*)
      (until C++20*)
      (until C++20*)
      (until C++17*)(until C++17*)
      (until C++17*)(until C++17*)

      (until C++17*)
      (until C++17*)(until C++17*)(until C++17*)(until C++17*)
      (until C++20*)
      (until C++20*)
       
       
      Defined in header<functional>
      template<class R,class...ArgTypes,class Alloc>
      struct uses_allocator<std::function<R(ArgTypes...)>, Alloc>:std::true_type{};
      (since C++11)
      (until C++17)

      This specialization ofstd::uses_allocator informs other library components that all objects of typestd::function supportuses-allocator construction, even though they do not have a nestedallocator_type.

      Contents

      [edit]Notes

      std::function's allocator support was poorly specified and inconsistently implemented. Some implementations do not support uses-allocator construction at all, some provide the needed constructor overloads but ignore the supplied allocator argument, and some provide the overloads and use the supplied allocator for construction but not when thestd::function is reassigned. As a result, allocator support was removed in C++17.

      Inherited fromstd::integral_constant

      Member constants

      value
      [static]
      true
      (public static member constant)

      Member functions

      operator bool
      converts the object tobool, returnsvalue
      (public member function)
      operator()
      (C++14)
      returnsvalue
      (public member function)

      Member types

      Type Definition
      value_typebool
      typestd::integral_constant<bool, value>

      [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/utility/functional/function/uses_allocator&oldid=139125"

      [8]ページ先頭

      ©2009-2025 Movatter.jp