From eeb32cca939697d04254f84b81b68d9b1b14951d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 24 Dec 2022 14:11:01 +0200 Subject: [PATCH] Capture value evaluation function by value Otherwise it will go out of scope if a temporary is passed. --- source/booleanevaluator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/booleanevaluator.cpp b/source/booleanevaluator.cpp index 58a6fcf..b7c399f 100644 --- a/source/booleanevaluator.cpp +++ b/source/booleanevaluator.cpp @@ -6,7 +6,7 @@ using namespace std; using namespace Msp; BooleanEvaluator::BooleanEvaluator(const ValueFunction &f): - func([&f](const string &value, const string *){ return f(value); }), + func([f](const string &value, const string *){ return f(value); }), ops("&|!") { } -- 2.43.0