RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
utils.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_COMPONENTFRAMEWORK_UTILS_HPP
13#define RTCTK_COMPONENTFRAMEWORK_UTILS_HPP
14
15#include <type_traits>
16
18
19// This is to check for dependencies between feature layers
20
21template <template <typename...> class Base, typename Derived>
22struct is_base_of_template_impl { // NOLINT(readability-identifier-naming)
23 template <typename... Ts>
24 // NOLINTNEXTLINE(readability-identifier-naming)
25 static constexpr std::true_type test(const Base<Ts...>*);
26 // NOLINTNEXTLINE(readability-identifier-naming)
27 static constexpr std::false_type test(...);
28 using type = decltype(test(std::declval<Derived*>()));
29};
30
31template <template <typename...> class Base, typename Derived>
33
34template <template <typename...> class Base, typename Derived>
35// NOLINTNEXTLINE(readability-identifier-naming)
37
38} // namespace rtctk::componentFramework
39
40#endif // RTCTK_COMPONENTFRAMEWORK_UTILS_HPP
Definition commandReplier.cpp:21
constexpr bool is_base_of_template_v
Definition utils.hpp:36
typename is_base_of_template_impl< Base, Derived >::type is_base_of_template
Definition utils.hpp:32
static constexpr std::false_type test(...)
decltype(test(std::declval< Derived * >())) type
Definition utils.hpp:28
static constexpr std::true_type test(const Base< Ts... > *)