From af7a5d7c492992d513537c3b36dd1882f0c5f38d Mon Sep 17 00:00:00 2001 From: Joshua Thompson Date: Thu, 22 Aug 2019 10:00:37 -0400 Subject: [PATCH] #487: Fix warning for implicit 'this' lambda capture in C++20. --- include/chaiscript/language/chaiscript_engine.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp index 63f9fc4e..d7da1257 100644 --- a/include/chaiscript/language/chaiscript_engine.hpp +++ b/include/chaiscript/language/chaiscript_engine.hpp @@ -156,7 +156,7 @@ namespace chaiscript m_engine.add(fun( - [=](const dispatch::Proxy_Function_Base &t_fun, const std::vector &t_params) -> Boxed_Value { + [=, this](const dispatch::Proxy_Function_Base &t_fun, const std::vector &t_params) -> Boxed_Value { Type_Conversions_State s(this->m_engine.conversions(), this->m_engine.conversions().conversion_saves()); return t_fun(Function_Params{t_params}, s); }), "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( - [=](const Type_Info &t_from, const Type_Info &t_to, const std::function &t_func) { + [=, this](const Type_Info &t_from, const Type_Info &t_to, const std::function &t_func) { m_engine.add(chaiscript::type_conversion(t_from, t_to, t_func)); } ), "add_type_conversion");