3-phase PV router
Loading...
Searching...
No Matches
is_base_of.hpp
Go to the documentation of this file.
1// ArduinoJson - https://arduinojson.org
2// Copyright © 2014-2024, Benoit BLANCHON
3// MIT License
4
5#pragma once
7
8// A meta-function that returns true if Derived inherits from TBase is an
9// integral type.
10template< typename TBase, typename TDerived >
12protected: // <- to avoid GCC's "all member functions in class are private"
13 static int probe(const TBase*);
14 static char probe(...);
15
16public:
17 static const bool value =
18 sizeof(probe(reinterpret_cast<remove_reference_t<TDerived>*>(0))) ==
19 sizeof(int);
20};
21
static int probe(const TBase *)
static char probe(...)
static const bool value
Definition: is_base_of.hpp:17
typename remove_reference< T >::type remove_reference_t