Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      deduction guides forstd::function_ref

      From cppreference.com
      <cpp‎ |utility‎ |functional‎ |function ref
       
       
      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 F>
      function_ref( F*)-> function_ref<F>;
      (1)(since C++26)
      template<auto f>
      function_ref(std::nontype_t<f>)-> function_ref</*see below*/>;
      (2)(since C++26)
      template<auto f,class T>
      function_ref(std::nontype_t<f>, T&&)-> function_ref</*see below*/>;
      (3)(since C++26)
      1) This overload participates in overload resolution only ifstd::is_function_v<F> istrue.
      2) Let typeF bestd::remove_pointer_t<decltype(f)>. This overload participates in overload resolution only ifstd::is_function_v<F> istrue. The deduced type isstd::function_ref<F>.
      3) Let typeF bedecltype(f). This overload participates in overload resolution only if :
      • F is of the formR(G::*)(A...)noexcept(E) (optionally cv-qualified, optionally noexcept, optionally lvalue reference qualified) for a typeG, or
      • F is of the formM G::* for a typeG and an object typeM, in which case letR bestd::invoke_result_t<F, T&>,A... be an empty pack, andE be false, or
      • F is of the formR(*)(G, A...)noexcept(E) for a typeG.
      The deduced type isstd::function_ref<R(A...)noexcept(E)>.

      [edit]Example

      This section is incomplete
      Reason: no example
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/functional/function_ref/deduction_guides&oldid=168404"

      [8]ページ先頭

      ©2009-2025 Movatter.jp