Audacity 3.2.0
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
Track::Dispatcher::Switch< Tag, R, ArgumentType, std::tuple< BaseClass, BaseClasses... > > Struct Template Reference

Recursive case, tries to match function with one base class of ArgumentType. More...

#include <Track.h>

Public Types

using QualifiedBaseClass = std::conditional_t< std::is_const_v< ArgumentType >, const BaseClass, BaseClass >
 
using Retry = Switch< Tag, R, ArgumentType, std::tuple< BaseClasses... > >
 Recur to this type to try the next base class. More...
 

Static Public Member Functions

template<typename Function , typename ... Functions>
static auto test (const void *) -> decltype(Retry::template test< Function, Functions... >())
 Catch-all overload of undefined function used in decltype only. More...
 
template<typename Function , typename ... Functions>
static auto test (std::true_type *) -> decltype((void) std::declval< Function >()((QualifiedBaseClass *) nullptr), applicable1< R, BaseClass, ArgumentType, Function >{})
 overload when upcast of ArgumentType* works, with sfinae'd return type More...
 
template<typename Function , typename ... Functions>
static auto test (std::true_type *) -> decltype((void) std::declval< Function >()((QualifiedBaseClass *) nullptr, std::declval< Continuation< R > >()), applicable2< Tag, R, BaseClass, ArgumentType, Function, Functions... >{})
 overload when upcast of ArgumentType* works, with sfinae'd return type More...
 
template<typename Function , typename ... Functions>
static auto test () -> decltype(test< Function, Functions... >((std::integral_constant< bool, Compatible > *) nullptr))
 undefined function used in decltype only to compute a type, using other overloads More...
 

Static Public Attributes

static constexpr bool Compatible
 Whether upcast of ArgumentType* to first BaseClass* works. More...
 

Detailed Description

template<typename Tag, typename R, typename ArgumentType, typename BaseClass, typename ... BaseClasses>
struct Track::Dispatcher::Switch< Tag, R, ArgumentType, std::tuple< BaseClass, BaseClasses... > >

Recursive case, tries to match function with one base class of ArgumentType.

Computes a type as the return type of undefined member test()

Definition at line 642 of file Track.h.

Member Typedef Documentation

◆ QualifiedBaseClass

template<typename Tag , typename R , typename ArgumentType , typename BaseClass , typename ... BaseClasses>
using Track::Dispatcher::Switch< Tag, R, ArgumentType, std::tuple< BaseClass, BaseClasses... > >::QualifiedBaseClass = std::conditional_t< std::is_const_v<ArgumentType>, const BaseClass, BaseClass >

Definition at line 644 of file Track.h.

◆ Retry

template<typename Tag , typename R , typename ArgumentType , typename BaseClass , typename ... BaseClasses>
using Track::Dispatcher::Switch< Tag, R, ArgumentType, std::tuple< BaseClass, BaseClasses... > >::Retry = Switch< Tag, R, ArgumentType, std::tuple<BaseClasses...> >

Recur to this type to try the next base class.

Definition at line 649 of file Track.h.

Member Function Documentation

◆ test() [1/4]

template<typename Tag , typename R , typename ArgumentType , typename BaseClass , typename ... BaseClasses>
template<typename Function , typename ... Functions>
static auto Track::Dispatcher::Switch< Tag, R, ArgumentType, std::tuple< BaseClass, BaseClasses... > >::test ( ) -> decltype(test< Function, Functions... >((std::integral_constant< bool, Compatible > *) nullptr))
static

undefined function used in decltype only to compute a type, using other overloads

◆ test() [2/4]

template<typename Tag , typename R , typename ArgumentType , typename BaseClass , typename ... BaseClasses>
template<typename Function , typename ... Functions>
static auto Track::Dispatcher::Switch< Tag, R, ArgumentType, std::tuple< BaseClass, BaseClasses... > >::test ( const void *  ) -> decltype(Retry::template test< Function, Functions... >())
static

Catch-all overload of undefined function used in decltype only.

If ArgumentType is not compatible with BaseClass, or if Function does not accept QualifiedBaseClass*, try other BaseClasses.

◆ test() [3/4]

template<typename Tag , typename R , typename ArgumentType , typename BaseClass , typename ... BaseClasses>
template<typename Function , typename ... Functions>
static auto Track::Dispatcher::Switch< Tag, R, ArgumentType, std::tuple< BaseClass, BaseClasses... > >::test ( std::true_type *  ) -> decltype((void) std::declval< Function >()((QualifiedBaseClass *) nullptr), applicable1< R, BaseClass, ArgumentType, Function >{})
static

overload when upcast of ArgumentType* works, with sfinae'd return type

If BaseClass is a base of ArgumentType and Function can take a pointer to it, then overload resolution chooses this. If not, then the sfinae rule makes this overload unavailable.

◆ test() [4/4]

template<typename Tag , typename R , typename ArgumentType , typename BaseClass , typename ... BaseClasses>
template<typename Function , typename ... Functions>
static auto Track::Dispatcher::Switch< Tag, R, ArgumentType, std::tuple< BaseClass, BaseClasses... > >::test ( std::true_type *  ) -> decltype((void) std::declval< Function >()((QualifiedBaseClass *) nullptr, std::declval< Continuation< R > >()), applicable2< Tag, R, BaseClass, ArgumentType, Function, Functions... >{})
static

overload when upcast of ArgumentType* works, with sfinae'd return type

If BaseClass is a base of ArgumentType and Function can take a pointer to it, with a second argument for a continuation, then overload resolution chooses this. If not, then the sfinae rule makes this overload unavailable.

Member Data Documentation

◆ Compatible

template<typename Tag , typename R , typename ArgumentType , typename BaseClass , typename ... BaseClasses>
constexpr bool Track::Dispatcher::Switch< Tag, R, ArgumentType, std::tuple< BaseClass, BaseClasses... > >::Compatible
staticconstexpr
Initial value:
=
std::is_base_of_v<BaseClass, ArgumentType>

Whether upcast of ArgumentType* to first BaseClass* works.

Definition at line 687 of file Track.h.


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