From 5aa0fea29b881d3f4c9e854aae5726ae2c4cc5e4 Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Tue, 1 Feb 2022 15:02:42 +0100 Subject: [PATCH] base: pass lambdas by reference in util/attempt.h genodelabs/genode#4393 --- repos/base/include/util/attempt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/base/include/util/attempt.h b/repos/base/include/util/attempt.h index d1252efd3d..3d24734b9d 100644 --- a/repos/base/include/util/attempt.h +++ b/repos/base/include/util/attempt.h @@ -53,20 +53,20 @@ class Genode::Attempt Attempt &operator = (Attempt const &) = default; template - RET convert(ACCESS_FN const &access_fn, FAIL_FN const fail_fn) const + RET convert(ACCESS_FN const &access_fn, FAIL_FN const &fail_fn) const { return _ok ? RET { access_fn(_result) } : RET { fail_fn(_error) }; } template - void with_result(ACCESS_FN const &access_fn, FAIL_FN const fail_fn) const + void with_result(ACCESS_FN const &access_fn, FAIL_FN const &fail_fn) const { _ok ? access_fn(_result) : fail_fn(_error); } template - void with_error(FAIL_FN const fail_fn) const + void with_error(FAIL_FN const &fail_fn) const { if (!_ok) fail_fn(_error);