smgl 0.11.0
Structured Metadata Engine and Graph Objects Library
Loading...
Searching...
No Matches
TypeTraits.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <memory>
6#include <type_traits>
7
8namespace smgl
9{
10namespace type_traits
11{
12
18template <class T>
23
25template <typename T>
27
32template <bool...>
33struct bool_pack;
34
40template <bool... v>
41using all_true = std::is_same<bool_pack<true, v...>, bool_pack<v..., true>>;
42
44template <bool... v>
45constexpr bool all_true_v = all_true<v...>::value;
46
51template <typename Ptr, typename Base>
54 bool,
55 std::is_convertible<
56 std::add_pointer_t<
57 typename std::pointer_traits<Ptr>::element_type>,
58 std::add_pointer_t<Base>>::value> {
59};
60
62template <typename Ptr, typename Base>
64 : is_ptr_to_base_helper<remove_cvref_t<Ptr>, remove_cvref_t<Base>> {
65};
66
68template <typename Ptr, typename Base>
70
71} // namespace type_traits
72} // namespace smgl
constexpr bool is_ptr_to_base_v
Checks if Ptr element type can be converted to Base.
constexpr bool all_true_v
Checks if all template conditions are true.
typename remove_cvref< T >::type remove_cvref_t
Removes const-qualifications and references from type.
Project top-level namespace.
Checks if Ptr element type can be converted to Base.
Removes const-qualifications and references from type.