mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
fix: missing move in eval.h (#3775)
This commit is contained in:
parent
af08a95b56
commit
2dd5254494
@ -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
|
|||||||
|
|
||||||
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)
|
#if defined(PYPY_VERSION)
|
||||||
|
Loading…
Reference in New Issue
Block a user