From: Mikko Rasa Date: Sat, 24 Dec 2022 12:11:01 +0000 (+0200) Subject: Capture value evaluation function by value X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=eeb32cca939697d04254f84b81b68d9b1b14951d;p=builder.git Capture value evaluation function by value Otherwise it will go out of scope if a temporary is passed. --- 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("&|!") { }