deductiongu...function_ref(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ NAME ✨

okay so bestie, we're deep in deductiongu...function_ref(3) from the C++ Standard Libary β€” yes, the header spells it β€œLibary,” and honestly? iconic. Buckle up, because this page is all about deduction guides for std::function_ref. πŸ’…

The name is literally deductionguidesforstd::function_ref β€” and the description? Also deductionguidesforstd::function_ref. No notes, that's the vibe. 🫢


🌸 Synopsis 🌸

Defined in header <functional> β€” yes bestie, <functional>, as in functional things. The deduction guides are giving:

template< class F >
(1) (since C++26)
function_ref( F* ) -> function_ref<F>;

template< auto f >
(2) (since C++26)
function_ref( std::nontype_t<f> ) -> function_ref</*see below*/>;

template< auto f, class T >
(3) (since C++26)
function_ref( std::nontype_t<f>, T&& ) -> function_ref</*see below*/>;

Here's the tea on each guide, fr fr:

  1. (1) (since C++26) β€” This overload participates in overload resolution only if std::is_function_v<F> is true. ✨
  2. (2) (since C++26) β€” Let type F be std::remove_pointer_t<decltype(f)>. This overload participates in overload resolution only if std::is_function_v<F> is true. The deduced type is std::function_ref<F>. 🌟
  3. (3) (since C++26) β€” Let type F be decltype(f). This overload participates in overload resolution only if:
    • F is of the form R(G::*)(A...) noexcept(E) (optionally cv-qualified, optionally noexcept, optionally lvalue reference qualified) for a type G, or
    • F is of the form M G::* for a type G and an object type M, in which case let R be std::invoke_result_t<F, T&>, A... be an empty pack, and E be false, or
    • F is of the form R(*)(G, A...) noexcept(E) for a type G.

The deduced type is std::function_ref<R(A...) noexcept(E)>. Periodt. πŸ”₯


🌈 Example 🌈

This section is incomplete Reason: no example

the example section is literally giving unfinished homework 😭


πŸŽ€ Category πŸŽ€

  • Todo no example

That's the whole category, bestie β€” Todo no example. 🫢


mwah πŸ’‹ β€” this cutie came from http://cppreference.com, dated 2024.06.10, and the page is deductiongu...function_ref(3). Slay responsibly, bestie. 🧚

πŸ“¦ where this page comes from