Audacity  3.0.3
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
Track::Dispatcher::Switch< R, ConcreteType, BaseClass, BaseClasses... > Struct Template Reference

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

#include <Track.h>

Public Types

using Retry = Switch< R, ConcreteType, 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 >()((BaseClass *) nullptr), applicable1< R, BaseClass, ConcreteType, Function, Functions... >
 overload when upcast of ConcreteType* works, with sfinae'd return type More...
 
template<typename Function , typename ... Functions>
static auto test (std::true_type *) -> decltype((void) std::declval< Function >()((BaseClass *) nullptr, std::declval< Continuation< R > >()), applicable2< R, BaseClass, ConcreteType, Function, Functions... >
 overload when upcast of ConcreteType* 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 ConcreteType* to first BaseClass* works. More...
 

Detailed Description

template<typename R, typename ConcreteType, typename BaseClass, typename ... BaseClasses>
struct Track::Dispatcher::Switch< R, ConcreteType, BaseClass, BaseClasses... >

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

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

Definition at line 576 of file Track.h.

Member Typedef Documentation

◆ Retry

template<typename R , typename ConcreteType , typename BaseClass , typename ... BaseClasses>
using Track::Dispatcher::Switch< R, ConcreteType, BaseClass, BaseClasses... >::Retry = Switch< R, ConcreteType, BaseClasses... >

Recur to this type to try the next base class.

Definition at line 579 of file Track.h.

Member Function Documentation

◆ test() [1/4]

template<typename R , typename ConcreteType , typename BaseClass , typename ... BaseClasses>
template<typename Function , typename ... Functions>
static auto Track::Dispatcher::Switch< R, ConcreteType, 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 R , typename ConcreteType , typename BaseClass , typename ... BaseClasses>
template<typename Function , typename ... Functions>
static auto Track::Dispatcher::Switch< R, ConcreteType, BaseClass, BaseClasses... >::test ( const void *  ) -> decltype(Retry::template test< Function, Functions... >())
static

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

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

◆ test() [3/4]

template<typename R , typename ConcreteType , typename BaseClass , typename ... BaseClasses>
template<typename Function , typename ... Functions>
static auto Track::Dispatcher::Switch< R, ConcreteType, BaseClass, BaseClasses... >::test ( std::true_type *  ) -> decltype( (void) std::declval<Function>() ( (BaseClass*)nullptr ), applicable1< R, BaseClass, ConcreteType, Function, Functions... >
inlinestatic

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

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

Definition at line 593 of file Track.h.

598  {}

◆ test() [4/4]

template<typename R , typename ConcreteType , typename BaseClass , typename ... BaseClasses>
template<typename Function , typename ... Functions>
static auto Track::Dispatcher::Switch< R, ConcreteType, BaseClass, BaseClasses... >::test ( std::true_type *  ) -> decltype( (void) std::declval<Function>() ( (BaseClass*)nullptr, std::declval< Continuation<R> >() ), applicable2< R, BaseClass, ConcreteType, Function, Functions... >
inlinestatic

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

If BaseClass is a base of ConcreteType 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.

Definition at line 607 of file Track.h.

613  {}

Member Data Documentation

◆ Compatible

template<typename R , typename ConcreteType , typename BaseClass , typename ... BaseClasses>
constexpr bool Track::Dispatcher::Switch< R, ConcreteType, BaseClass, BaseClasses... >::Compatible
staticconstexpr
Initial value:
track_kind<BaseClass>(), track_kind<ConcreteType>() )

Whether upcast of ConcreteType* to first BaseClass* works.

Definition at line 617 of file Track.h.


The documentation for this struct was generated from the following file:
CompatibleTrackKinds
constexpr bool CompatibleTrackKinds(TrackKind desired, TrackKind actual)
Compile-time function on enum values.
Definition: Track.h:85