eigenpy 3.12.0
Bindings between Numpy and Eigen using Boost.Python
Loading...
Searching...
No Matches
traits.hpp
1//
2// Copyright (c) 2024 INRIA
3//
4//
5
6#ifndef __eigenpy_utils_traits_hpp__
7#define __eigenpy_utils_traits_hpp__
8
9#include <type_traits>
10#include <string>
11#include <complex>
12
13namespace eigenpy {
14
15namespace details {
16
18template <typename T>
19struct remove_cvref : std::remove_cv<typename std::remove_reference<T>::type> {
20};
21
23template <typename T>
25 : std::integral_constant<bool, std::is_class<T>::value ||
26 std::is_union<T>::value> {};
27
29template <typename T>
30struct is_python_complex : std::false_type {};
31
33template <>
34struct is_python_complex<std::complex<float>> : std::true_type {};
35template <>
36struct is_python_complex<std::complex<double>> : std::true_type {};
37template <>
38struct is_python_complex<std::complex<long double>> : std::true_type {};
39
40template <typename T>
42 : std::integral_constant<bool, !is_class_or_union<T>::value ||
43 std::is_same<T, std::string>::value ||
44 std::is_same<T, std::wstring>::value ||
45 is_python_complex<T>::value> {};
46
48template <typename T>
50 : is_python_primitive_type_helper<typename remove_cvref<T>::type> {};
51
52} // namespace details
53
54} // namespace eigenpy
55
56#endif // ifndef __eigenpy_utils_traits_hpp__
Trait to detect if T is a class or an union.
Definition traits.hpp:26
trait to detect if T is a std::complex managed by Boost Python
Definition traits.hpp:30
Trait to detect if T is a Python primitive type.
Definition traits.hpp:50
Trait to remove const&.
Definition traits.hpp:19