Audacity 3.2.0
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Callable::detail::MemberInvoker< M, C > Struct Template Reference

Capture pointer to member. More...

#include <Callable.h>

Classes

struct  CanAccept
 
struct  CanAccept< T, std::void_t< Result< T > > >
 

Public Types

using Member = M C::*
 
template<typename T >
using Result = std::invoke_result_t< Member, T >
 

Public Member Functions

constexpr MemberInvoker (Member member)
 
template<typename Obj >
auto operator() (Obj &&obj) const -> std::enable_if_t< CanAccept< Obj && >::value, Result< Obj && > >
 

Public Attributes

Member member
 

Detailed Description

template<typename M, typename C>
struct Callable::detail::MemberInvoker< M, C >

Capture pointer to member.

Definition at line 35 of file Callable.h.

Member Typedef Documentation

◆ Member

template<typename M , typename C >
using Callable::detail::MemberInvoker< M, C >::Member = M C::*

Definition at line 36 of file Callable.h.

◆ Result

template<typename M , typename C >
template<typename T >
using Callable::detail::MemberInvoker< M, C >::Result = std::invoke_result_t<Member, T>

Definition at line 37 of file Callable.h.

Constructor & Destructor Documentation

◆ MemberInvoker()

template<typename M , typename C >
constexpr Callable::detail::MemberInvoker< M, C >::MemberInvoker ( Member  member)
inlineexplicitconstexpr

Definition at line 42 of file Callable.h.

Member Function Documentation

◆ operator()()

template<typename M , typename C >
template<typename Obj >
auto Callable::detail::MemberInvoker< M, C >::operator() ( Obj &&  obj) const -> std::enable_if_t<CanAccept<Obj&&>::value, Result<Obj&&>>
inline

Cover all cases of std::invoke, with perfect forwarding, and sfinae eliminates the overloads for argument types for which it is inapplicable

Definition at line 46 of file Callable.h.

48 {
49 return std::invoke(member, std::forward<Obj>(obj));
50 }

References Callable::detail::MemberInvoker< M, C >::member.

Member Data Documentation

◆ member

template<typename M , typename C >
Member Callable::detail::MemberInvoker< M, C >::member

Definition at line 51 of file Callable.h.

Referenced by Callable::detail::MemberInvoker< M, C >::operator()().


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