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
dd617dec
Commit
dd617dec
authored
Mar 02, 2022
by
Aaron Gokaslan
Committed by
Henry Schreiner
Mar 02, 2022
Browse files
fix: missing move in eval.h (#3775)
parent
45219c6b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
include/pybind11/eval.h
include/pybind11/eval.h
+2
-2
No files found.
include/pybind11/eval.h
View file @
dd617dec
...
@@ -82,7 +82,7 @@ template <eval_mode mode = eval_expr, size_t N>
...
@@ -82,7 +82,7 @@ template <eval_mode mode = eval_expr, size_t N>
object
eval
(
const
char
(
&
s
)[
N
],
object
global
=
globals
(),
object
local
=
object
())
{
object
eval
(
const
char
(
&
s
)[
N
],
object
global
=
globals
(),
object
local
=
object
())
{
/* Support raw string literals by removing common leading whitespace */
/* Support raw string literals by removing common leading whitespace */
auto
expr
=
(
s
[
0
]
==
'\n'
)
?
str
(
module_
::
import
(
"textwrap"
).
attr
(
"dedent"
)(
s
))
:
str
(
s
);
auto
expr
=
(
s
[
0
]
==
'\n'
)
?
str
(
module_
::
import
(
"textwrap"
).
attr
(
"dedent"
)(
s
))
:
str
(
s
);
return
eval
<
mode
>
(
expr
,
global
,
local
);
return
eval
<
mode
>
(
expr
,
std
::
move
(
global
)
,
std
::
move
(
local
)
)
;
}
}
inline
void
exec
(
const
str
&
expr
,
object
global
=
globals
(),
object
local
=
object
())
{
inline
void
exec
(
const
str
&
expr
,
object
global
=
globals
(),
object
local
=
object
())
{
...
@@ -91,7 +91,7 @@ inline void exec(const str &expr, object global = globals(), object local = obje
...
@@ -91,7 +91,7 @@ inline void exec(const str &expr, object global = globals(), object local = obje
template
<
size_t
N
>
template
<
size_t
N
>
void
exec
(
const
char
(
&
s
)[
N
],
object
global
=
globals
(),
object
local
=
object
())
{
void
exec
(
const
char
(
&
s
)[
N
],
object
global
=
globals
(),
object
local
=
object
())
{
eval
<
eval_statements
>
(
s
,
global
,
local
);
eval
<
eval_statements
>
(
s
,
std
::
move
(
global
)
,
std
::
move
(
local
)
)
;
}
}
#if defined(PYPY_VERSION) && PY_VERSION_HEX >= 0x03000000
#if defined(PYPY_VERSION) && PY_VERSION_HEX >= 0x03000000
...
...
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