WPILibC++ 2025.3.1
Loading...
Searching...
No Matches
sleipnir::function_ref< R(Args...)> Class Template Reference

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/util/FunctionRef.hpp>

Public Member Functions

constexpr function_ref () noexcept=delete
 
constexpr function_ref (const function_ref< R(Args...)> &rhs) noexcept=default
 Creates a function_ref which refers to the same callable as rhs.
 
template<typename F >
requires (!std::is_same_v<std::decay_t<F>, function_ref> && std::is_invocable_r_v<R, F &&, Args...>)
constexpr function_ref (F &&f) noexcept
 Constructs a function_ref referring to f.
 
constexpr function_ref< R(Args...)> & operator= (const function_ref< R(Args...)> &rhs) noexcept=default
 Makes *this refer to the same callable as rhs.
 
template<typename F >
requires std::is_invocable_r_v<R, F&&, Args...>
constexpr function_ref< R(Args...)> & operator= (F &&f) noexcept
 Makes *this refer to f.
 
constexpr void swap (function_ref< R(Args...)> &rhs) noexcept
 Swaps the referred callables of *this and rhs.
 
operator() (Args... args) const
 Call the stored callable with the given arguments.
 

Constructor & Destructor Documentation

◆ function_ref() [1/3]

template<class R , class... Args>
sleipnir::function_ref< R(Args...)>::function_ref ( )
constexprdeletenoexcept

◆ function_ref() [2/3]

template<class R , class... Args>
sleipnir::function_ref< R(Args...)>::function_ref ( const function_ref< R(Args...)> & rhs)
constexprdefaultnoexcept

Creates a function_ref which refers to the same callable as rhs.

◆ function_ref() [3/3]

template<class R , class... Args>
template<typename F >
requires (!std::is_same_v<std::decay_t<F>, function_ref> && std::is_invocable_r_v<R, F &&, Args...>)
sleipnir::function_ref< R(Args...)>::function_ref ( F && f)
inlineconstexprnoexcept

Constructs a function_ref referring to f.

Member Function Documentation

◆ operator()()

template<class R , class... Args>
R sleipnir::function_ref< R(Args...)>::operator() ( Args... args) const
inline

Call the stored callable with the given arguments.

◆ operator=() [1/2]

template<class R , class... Args>
function_ref< R(Args...)> & sleipnir::function_ref< R(Args...)>::operator= ( const function_ref< R(Args...)> & rhs)
constexprdefaultnoexcept

Makes *this refer to the same callable as rhs.

◆ operator=() [2/2]

template<class R , class... Args>
template<typename F >
requires std::is_invocable_r_v<R, F&&, Args...>
function_ref< R(Args...)> & sleipnir::function_ref< R(Args...)>::operator= ( F && f)
inlineconstexprnoexcept

Makes *this refer to f.

◆ swap()

template<class R , class... Args>
void sleipnir::function_ref< R(Args...)>::swap ( function_ref< R(Args...)> & rhs)
inlineconstexprnoexcept

Swaps the referred callables of *this and rhs.


The documentation for this class was generated from the following file: