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
13
namespace
eigenpy
{
14
15
namespace
details {
16
18
template
<
typename
T>
19
struct
remove_cvref
: std::remove_cv<typename std::remove_reference<T>::type> {
20
};
21
23
template
<
typename
T>
24
struct
is_class_or_union
25
: std::integral_constant<bool, std::is_class<T>::value ||
26
std::is_union<T>::value> {};
27
29
template
<
typename
T>
30
struct
is_python_complex
: std::false_type {};
31
33
template
<>
34
struct
is_python_complex
<std::complex<float>> : std::true_type {};
35
template
<>
36
struct
is_python_complex<std::complex<double>> : std::true_type {};
37
template
<>
38
struct
is_python_complex<std::complex<long double>> : std::true_type {};
39
40
template
<
typename
T>
41
struct
is_python_primitive_type_helper
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
48
template
<
typename
T>
49
struct
is_python_primitive_type
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__
eigenpy
Definition
alignment.hpp:14
eigenpy::details::is_class_or_union
Trait to detect if T is a class or an union.
Definition
traits.hpp:26
eigenpy::details::is_python_complex
trait to detect if T is a std::complex managed by Boost Python
Definition
traits.hpp:30
eigenpy::details::is_python_primitive_type_helper
Definition
traits.hpp:45
eigenpy::details::is_python_primitive_type
Trait to detect if T is a Python primitive type.
Definition
traits.hpp:50
eigenpy::details::remove_cvref
Trait to remove const&.
Definition
traits.hpp:19
include
eigenpy
utils
traits.hpp
Generated by
1.14.0