Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
edbd4cb0
Commit
edbd4cb0
authored
Aug 15, 2016
by
Ivan Smirnov
Browse files
Decay const qualifiers in is_pod_struct<>
parent
6ecb5b15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
include/pybind11/numpy.h
include/pybind11/numpy.h
+8
-5
No files found.
include/pybind11/numpy.h
View file @
edbd4cb0
...
@@ -29,6 +29,8 @@ NAMESPACE_BEGIN(pybind11)
...
@@ -29,6 +29,8 @@ NAMESPACE_BEGIN(pybind11)
namespace
detail
{
namespace
detail
{
template
<
typename
type
,
typename
SFINAE
=
void
>
struct
npy_format_descriptor
{
};
template
<
typename
type
,
typename
SFINAE
=
void
>
struct
npy_format_descriptor
{
};
template
<
typename
type
>
struct
is_pod_struct
;
template
<
typename
type
>
struct
is_pod_struct
;
template
<
typename
T
>
using
decay_cv_ref
=
typename
std
::
remove_cv
<
typename
std
::
remove_reference
<
T
>::
type
>::
type
;
struct
npy_api
{
struct
npy_api
{
enum
constants
{
enum
constants
{
...
@@ -321,14 +323,15 @@ template <typename T, size_t N> struct is_std_array<std::array<T, N>> : std::tru
...
@@ -321,14 +323,15 @@ template <typename T, size_t N> struct is_std_array<std::array<T, N>> : std::tru
template
<
typename
T
>
template
<
typename
T
>
struct
is_pod_struct
{
struct
is_pod_struct
{
enum
{
value
=
std
::
is_pod
<
T
>::
value
&&
// offsetof only works correctly for POD types
enum
{
value
=
std
::
is_pod
<
T
>::
value
&&
// offsetof only works correctly for POD types
!
std
::
is_reference
<
T
>::
value
&&
!
std
::
is_array
<
T
>::
value
&&
!
std
::
is_array
<
T
>::
value
&&
!
is_std_array
<
T
>::
value
&&
!
is_std_array
<
T
>::
value
&&
!
std
::
is_integral
<
T
>::
value
&&
!
std
::
is_integral
<
T
>::
value
&&
!
std
::
is_same
<
T
,
float
>::
value
&&
!
std
::
is_same
<
typename
std
::
remove_cv
<
T
>::
type
,
float
>::
value
&&
!
std
::
is_same
<
T
,
double
>::
value
&&
!
std
::
is_same
<
typename
std
::
remove_cv
<
T
>::
type
,
double
>::
value
&&
!
std
::
is_same
<
T
,
bool
>::
value
&&
!
std
::
is_same
<
typename
std
::
remove_cv
<
T
>::
type
,
bool
>::
value
&&
!
std
::
is_same
<
T
,
std
::
complex
<
float
>>::
value
&&
!
std
::
is_same
<
typename
std
::
remove_cv
<
T
>::
type
,
std
::
complex
<
float
>>::
value
&&
!
std
::
is_same
<
T
,
std
::
complex
<
double
>>::
value
};
!
std
::
is_same
<
typename
std
::
remove_cv
<
T
>::
type
,
std
::
complex
<
double
>>::
value
};
};
};
template
<
typename
T
>
struct
npy_format_descriptor
<
T
,
typename
std
::
enable_if
<
std
::
is_integral
<
T
>::
value
>::
type
>
{
template
<
typename
T
>
struct
npy_format_descriptor
<
T
,
typename
std
::
enable_if
<
std
::
is_integral
<
T
>::
value
>::
type
>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment