Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
b72c79f9
Commit
b72c79f9
authored
Oct 15, 2020
by
Henry Schreiner
Committed by
Henry Schreiner
Oct 15, 2020
Browse files
fix: std::is_pod -> pybind11::detail::is_pod
parent
f2008325
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
include/pybind11/numpy.h
include/pybind11/numpy.h
+8
-1
No files found.
include/pybind11/numpy.h
View file @
b72c79f9
...
...
@@ -20,6 +20,7 @@
#include <sstream>
#include <string>
#include <functional>
#include <type_traits>
#include <utility>
#include <vector>
#include <typeindex>
...
...
@@ -328,6 +329,12 @@ template <typename T> using is_pod_struct = all_of<
satisfies_none_of
<
T
,
std
::
is_reference
,
std
::
is_array
,
is_std_array
,
std
::
is_arithmetic
,
is_complex
,
std
::
is_enum
>
>
;
// Replacement for std::is_pod (deprecated in C++20)
template
<
typename
T
>
using
is_pod
=
all_of
<
std
::
is_standard_layout
<
T
>
,
std
::
is_trivial
<
T
>
>
;
template
<
ssize_t
Dim
=
0
,
typename
Strides
>
ssize_t
byte_offset_unsafe
(
const
Strides
&
)
{
return
0
;
}
template
<
ssize_t
Dim
=
0
,
typename
Strides
,
typename
...
Ix
>
ssize_t
byte_offset_unsafe
(
const
Strides
&
strides
,
ssize_t
i
,
Ix
...
index
)
{
...
...
@@ -1448,7 +1455,7 @@ struct vectorize_arg {
using
call_type
=
remove_reference_t
<
T
>
;
// Is this a vectorized argument?
static
constexpr
bool
vectorize
=
satisfies_any_of
<
call_type
,
std
::
is_arithmetic
,
is_complex
,
std
::
is_pod
>::
value
&&
satisfies_any_of
<
call_type
,
std
::
is_arithmetic
,
is_complex
,
is_pod
>::
value
&&
satisfies_none_of
<
call_type
,
std
::
is_pointer
,
std
::
is_array
,
is_std_array
,
std
::
is_enum
>::
value
&&
(
!
std
::
is_reference
<
T
>::
value
||
(
std
::
is_lvalue_reference
<
T
>::
value
&&
std
::
is_const
<
call_type
>::
value
));
...
...
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