mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 01:06:54 +08:00
Merge pull request #495 from Josh-Thompson/#487
#487: Fix warning for implicit 'this' lambda capture in C++20.
This commit is contained in:
commit
d355787820
@ -156,7 +156,7 @@ namespace chaiscript
|
|||||||
|
|
||||||
|
|
||||||
m_engine.add(fun(
|
m_engine.add(fun(
|
||||||
[=](const dispatch::Proxy_Function_Base &t_fun, const std::vector<Boxed_Value> &t_params) -> Boxed_Value {
|
[=, this](const dispatch::Proxy_Function_Base &t_fun, const std::vector<Boxed_Value> &t_params) -> Boxed_Value {
|
||||||
Type_Conversions_State s(this->m_engine.conversions(), this->m_engine.conversions().conversion_saves());
|
Type_Conversions_State s(this->m_engine.conversions(), this->m_engine.conversions().conversion_saves());
|
||||||
return t_fun(Function_Params{t_params}, s);
|
return t_fun(Function_Params{t_params}, s);
|
||||||
}), "call");
|
}), "call");
|
||||||
@ -168,7 +168,7 @@ namespace chaiscript
|
|||||||
m_engine.add(fun([this](const std::string &t_type_name){ return m_engine.get_type(t_type_name, true); }), "type");
|
m_engine.add(fun([this](const std::string &t_type_name){ return m_engine.get_type(t_type_name, true); }), "type");
|
||||||
|
|
||||||
m_engine.add(fun(
|
m_engine.add(fun(
|
||||||
[=](const Type_Info &t_from, const Type_Info &t_to, const std::function<Boxed_Value (const Boxed_Value &)> &t_func) {
|
[=, this](const Type_Info &t_from, const Type_Info &t_to, const std::function<Boxed_Value (const Boxed_Value &)> &t_func) {
|
||||||
m_engine.add(chaiscript::type_conversion(t_from, t_to, t_func));
|
m_engine.add(chaiscript::type_conversion(t_from, t_to, t_func));
|
||||||
}
|
}
|
||||||
), "add_type_conversion");
|
), "add_type_conversion");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user