Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::fun< Ret(Args...)> Class Template Reference

Public Types

using result_type = Ret

Public Member Functions

template<typename F>
requires ( !std::is_same_v<std::decay_t<F>, fun> && !std::is_same_v<std::decay_t<F>, std::function<Ret(Args...)>> &&
!std::is_same_v<std::decay_t<F>, std::nullptr_t> && std::is_constructible_v<std::function<Ret(Args...)>, F>)
 fun (F &&callable)
 fun (const std::function< Ret(Args...)> &fn)
 fun (std::function< Ret(Args...)> &&fn)
 fun (std::nullptr_t)=delete
template<typename... Ts>
Ret operator() (Ts &&... args) const
const std::function< Ret(Args...)> & get_fn () const &
std::function< Ret(Args...)> get_fn () &&

Constructor & Destructor Documentation

◆ fun() [1/3]

template<typename Ret, typename... Args>
template<typename F>
requires ( !std::is_same_v<std::decay_t<F>, fun> && !std::is_same_v<std::decay_t<F>, std::function<Ret(Args...)>> &&
!std::is_same_v<std::decay_t<F>, std::nullptr_t> && std::is_constructible_v<std::function<Ret(Args...)>, F>)
nix::fun< Ret(Args...)>::fun ( F && callable)
inline

Construct from any callable that std::function accepts.

Excludes fun itself (handled by copy/move), std::function (handled by explicit constructors below), and nullptr.

◆ fun() [2/3]

template<typename Ret, typename... Args>
nix::fun< Ret(Args...)>::fun ( const std::function< Ret(Args...)> & fn)
inlineexplicit

Construct from an existing std::function. Explicit because an empty std::function will throw.

◆ fun() [3/3]

template<typename Ret, typename... Args>
nix::fun< Ret(Args...)>::fun ( std::nullptr_t )
delete

Prevent construction from nullptr at compile time.

Member Function Documentation

◆ get_fn()

template<typename Ret, typename... Args>
const std::function< Ret(Args...)> & nix::fun< Ret(Args...)>::get_fn ( ) const &
inline

Get the underlying std::function.


The documentation for this class was generated from the following file:
  • libutil/include/nix/util/fun.hh