Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::function<R(Args...)>::assign

      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*)
       
       
      template<class F,class Alloc>
      void assign( F&& f,const Alloc& alloc);
      (since C++11)
      (removed in C++17)

      Initializes thetarget withf. Thealloc is used to allocate memory for any internal data structures that thefunction might use.

      Equivalent tofunction(std::allocator_arg, alloc,std::forward<F>(f)).swap(*this);.

      Contents

      [edit]Parameters

      f - callable function to initialize thetarget with
      alloc - allocator to use to allocate memory for the internal data structures

      [edit]Return value

      (none)

      [edit]Exceptions

      May throw implementation-defined exceptions.

      [edit]See also

      assigns a new target
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/functional/function/assign&oldid=134337"

      [8]ページ先頭

      ©2009-2025 Movatter.jp