A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
is_derived_from_template< Base, Derived > Struct Template Reference

#include <Common.hh>

Description

template<template< typename... > class Base, typename Derived>
struct is_derived_from_template< Base, Derived >

Helper template which uses function overloading and implict up-casting to determine whether or not a class is derived from a templated base class (i.e. MapdataPointInfoAccessor derives from MapdataAccessorBase). See: https://en.cppreference.com/w/cpp/language/sfinae.

Definition at line 383 of file Common.hh.

Static Public Attributes

static constexpr bool value = decltype(test(std::declval<Derived *>()))::value
 

Static Private Member Functions

template<typename... Ts>
static std::true_type test (const Base< Ts... > *)
 
static std::false_type test (...)
 

Member Data Documentation

◆ value

template<template< typename... > class Base, typename Derived >
bool is_derived_from_template< Base, Derived >::value = decltype(test(std::declval<Derived *>()))::value
staticconstexpr

Definition at line 391 of file Common.hh.