mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 01:06:54 +08:00
Fix for warnings: by-copy capture of ‘this’ and unused-local-typedefs
There are two warnings when compiling with GCC 7.4.1 or clang 5.0.1. 1. warning: explicit by-copy capture of ‘this’ redundant with by-copy capture default 2. warning: typedef ... locally defined but not used [-Wunused-local-typedefs] This change removes [2] and it compacts the lambda capture clause in [1].
This commit is contained in:
parent
a7dae37a23
commit
85e4598986
@ -156,7 +156,7 @@ namespace chaiscript
|
|||||||
|
|
||||||
|
|
||||||
m_engine.add(fun(
|
m_engine.add(fun(
|
||||||
[=, this](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(
|
||||||
[=, this](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");
|
||||||
|
|||||||
@ -331,7 +331,6 @@ namespace chaiscript
|
|||||||
|
|
||||||
Boxed_Value fn(this->children[0]->eval(t_ss));
|
Boxed_Value fn(this->children[0]->eval(t_ss));
|
||||||
|
|
||||||
using ConstFunctionTypePtr = const dispatch::Proxy_Function_Base *;
|
|
||||||
try {
|
try {
|
||||||
return (*t_ss->boxed_cast<const dispatch::Proxy_Function_Base *>(fn))(Function_Params{params}, t_ss.conversions());
|
return (*t_ss->boxed_cast<const dispatch::Proxy_Function_Base *>(fn))(Function_Params{params}, t_ss.conversions());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user