Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::function

      From cppreference.com
      <cpp‎ |experimental
       
       
       
       
       
      Defined in header<experimental/functional>
      template<class>
      class function;/* undefined */
      (library fundamentals TS)
      template<class R,class...Args>
      class function<R(Args...)>
      (library fundamentals TS)

      std::experimental::function is a modified version ofstd::function with support for type-erased allocators.

      Contents

      [edit]Member types

      Type Definition
      allocator_type

      std::experimental::erased_type

      (library fundamentals TS)
      (until library fundamentals TS v3)

      std::pmr::polymorphic_allocator<>

      (library fundamentals TS v3)

      [edit]Member functions

      constructs a newstd::experimental::function instance
      (public member function)[edit]
      assigns a new target
      (public member function)[edit]
      swaps the contents
      (public member function)[edit]
      (removed in library fundamentals TS v3)
      retrieves a pointer to the memory resource used by this object to allocate memory
      (public member function)[edit]
      (library fundamentals TS v3)
      retrieves a type-erasedstd::pmr::polymorphic_allocator used by this object to allocate memory
      (public member function)[edit]

      [edit]Non-member functions

      specializes theswap algorithm
      (function template)[edit]
      (removed in library fundamentals TS v3)
      compares anstd::experimental::function withnullptr
      (function template)[edit]

      [edit]Helper classes

      (removed in library fundamentals TS v3)
      specializes thestd::uses_allocator type trait
      (class template specialization)[edit]

      Members identical tostd::function

      Member types

      Type Definition
      result_typeR
      Member types removed in Library Fundamental TS v3
      argument_typeT ifsizeof...(Args)==1 andT is the first and only type inArgs...
      first_argument_typeT1 ifsizeof...(Args)==2 andT1 is the first of the two types inArgs...
      second_argument_typeT2 ifsizeof...(Args)==2 andT2 is the second of the two types inArgs...

      Member typesargument_type,first_argument_type, andsecond_argument_type are removed, because the correponding member types ofstd::function are removed in C++20.

      (library fundamentals TS v3)

      Member functions

      destroys astd::function instance
      (public member function ofstd::function<R(Args...)>)[edit]
      checks if a target is contained
      (public member function ofstd::function<R(Args...)>)[edit]
      invokes the target
      (public member function ofstd::function<R(Args...)>)[edit]
      Target access
      obtains thetypeid of the stored target
      (public member function ofstd::function<R(Args...)>)[edit]
      obtains a pointer to the stored target
      (public member function ofstd::function<R(Args...)>)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/function&oldid=164105"

      [8]ページ先頭

      ©2009-2025 Movatter.jp