TemplateMetaProgrammingBoost.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
5#include <boost/shared_ptr.hpp>
6
8
9namespace armarx::meta
10{
11 template <class T, class = void>
12 struct pointer_type_traits : std::false_type
13 {
14 };
15
16 template <class T>
17 struct pointer_type_traits<T*, void> : std::true_type
18 {
19 using pointee_t = T;
20 };
21
22 template <class T>
24 T,
25 std::enable_if_t<
26 TypeTemplateTraits::
27 IsInstanceOfAnyV<T, boost::shared_ptr, std::shared_ptr, std::unique_ptr>>> :
28 std::true_type
29 {
30 using pointee_t = typename T::element_type;
31 };
32
33 template <class T>
34 static constexpr bool is_pointer_type_v = pointer_type_traits<T>::value;
35
36 template <class T>
38} // namespace armarx::meta
typename pointer_type_traits< T >::pointee_t pointer_type_pointee_t