xentara-utils v2.0.3
The Xentara Utility Library
Loading...
Searching...
No Matches
xentara::utils::functional Namespace Reference

Tools used for function-like objects. More...

Classes

class  function_ref
 Implementation of std::function_ref More...
 
class  function_ref< R(ArgTypes...) const >
 Specialization of xentara::utils::functional::function_ref for callable with signature auto (ArgTypes...) const -> R. More...
 
class  function_ref< R(ArgTypes...) const noexcept >
 Specialization of xentara::utils::functional::function_ref for callable with signature auto (ArgTypes...) const noexcept -> R. More...
 
class  function_ref< R(ArgTypes...) noexcept >
 Specialization of xentara::utils::functional::function_ref for callable with signature auto (ArgTypes...) noexcept -> R. More...
 
class  function_ref< R(ArgTypes...)>
 Specialization of xentara::utils::functional::function_ref for callable with signature auto (ArgTypes...) -> R. More...
 
struct  nontype_t
 Implementation of std::nontype_t More...
 

Functions

template<class F >
requires std::is_function_v<F>
 function_ref (F *) -> function_ref< F >
 Deduction guide for a function_ref from a function pointer.
 
template<auto f>
requires std::is_function_v<std::remove_pointer_t<decltype(f)>>
 function_ref (nontype_t< f >) -> function_ref< std::remove_pointer_t< dectype(f)> >
 Deduction guide for a function_ref from xentara::utils::functional::nontype.
 
template<auto f, class T >
 function_ref (nontype_t< f >, auto) -> function_ref< __exposition_only_deduce_signature< f, T > >
 Deduction guide for a function_ref from xentara::utils::functional::nontype and an argument.
 

Variables

template<auto V>
constexpr nontype_t< V > nontype
 Implementation of std::nontype_t
 

Detailed Description

Tools used for function-like objects.

This namespace contains facilities for using function-like objects like function pointers, callables, functors, etc.

Function Documentation

◆ function_ref() [1/3]

template<class F >
requires std::is_function_v<F>
xentara::utils::functional::function_ref ( F *  ) -> function_ref< F >

Deduction guide for a function_ref from a function pointer.

◆ function_ref() [2/3]

◆ function_ref() [3/3]

template<auto f, class T >
xentara::utils::functional::function_ref ( nontype_t< f >  ,
auto   
) -> function_ref< __exposition_only_deduce_signature< f, T > >

Deduction guide for a function_ref from xentara::utils::functional::nontype and an argument.

This deduction guide has very complex constraints, which are not shown here, but is essentially used for:

  • Binding pointers to member functions to an object
  • Binding pointers to member objects to an object
  • Binding pointers to functions to their first parameter

Variable Documentation

◆ nontype

template<auto V>
constexpr nontype_t<V> xentara::utils::functional::nontype
constexpr

Implementation of std::nontype_t

This is an implementation of the proposed std::nontype_t from P0792R13 from C++23, taken from https://github.com/zhihaoy/nontype_functional.

nontype is a helper object used to construct function_ref objects from pointers to members.

Include file
#include <xentara/utils/functional/functional_ref.hpp>