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
9bb33131
Commit
9bb33131
authored
Apr 07, 2019
by
Henry Schreiner
Committed by
Wenzel Jakob
Apr 07, 2019
Browse files
Fixing warnings about conversions in GCC 7+ (#1753)
parent
73b840dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
include/pybind11/numpy.h
include/pybind11/numpy.h
+2
-2
No files found.
include/pybind11/numpy.h
View file @
9bb33131
...
@@ -855,14 +855,14 @@ public:
...
@@ -855,14 +855,14 @@ public:
// Reference to element at a given index
// Reference to element at a given index
template
<
typename
...
Ix
>
const
T
&
at
(
Ix
...
index
)
const
{
template
<
typename
...
Ix
>
const
T
&
at
(
Ix
...
index
)
const
{
if
(
sizeof
...(
index
)
!=
ndim
())
if
(
(
ssize_t
)
sizeof
...(
index
)
!=
ndim
())
fail_dim_check
(
sizeof
...(
index
),
"index dimension mismatch"
);
fail_dim_check
(
sizeof
...(
index
),
"index dimension mismatch"
);
return
*
(
static_cast
<
const
T
*>
(
array
::
data
())
+
byte_offset
(
ssize_t
(
index
)...)
/
itemsize
());
return
*
(
static_cast
<
const
T
*>
(
array
::
data
())
+
byte_offset
(
ssize_t
(
index
)...)
/
itemsize
());
}
}
// Mutable reference to element at a given index
// Mutable reference to element at a given index
template
<
typename
...
Ix
>
T
&
mutable_at
(
Ix
...
index
)
{
template
<
typename
...
Ix
>
T
&
mutable_at
(
Ix
...
index
)
{
if
(
sizeof
...(
index
)
!=
ndim
())
if
(
(
ssize_t
)
sizeof
...(
index
)
!=
ndim
())
fail_dim_check
(
sizeof
...(
index
),
"index dimension mismatch"
);
fail_dim_check
(
sizeof
...(
index
),
"index dimension mismatch"
);
return
*
(
static_cast
<
T
*>
(
array
::
mutable_data
())
+
byte_offset
(
ssize_t
(
index
)...)
/
itemsize
());
return
*
(
static_cast
<
T
*>
(
array
::
mutable_data
())
+
byte_offset
(
ssize_t
(
index
)...)
/
itemsize
());
}
}
...
...
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