Drop std::function from try_catch() and friends, deficient edition 00/276900/2
authorKonrad Lipinski <k.lipinski2@samsung.com>
Mon, 16 May 2022 17:39:29 +0000 (19:39 +0200)
committerKonrad Lipinski <k.lipinski2@samsung.com>
Tue, 2 Aug 2022 11:01:22 +0000 (13:01 +0200)
commit6a6b758553a6db651e2a0064e9be61ebc499acfd
tree70f9cf556b6bdaea8398ac968a3867739c86f93f
parent19610331690f0caa95caef66a09a791b1dfba0f7
Drop std::function from try_catch() and friends, deficient edition

When used as an argument to try_catch() and similar functions,
std::function may potentially introduce runtime overhead on the
exception-free path, possibly even allocate (and thus throw
std::bad_alloc).

This can be prevented by rewriting try_catch() as a generic wrapper with
perfect forwarding.

This has been coded deficiently on purpose, refusing to leverage any and
all kinds of bloat reduction opportunities. For the rationale, please
consult code review participants as I have none to give.

  "I'm only following orders."
    - A nameless soldier

Change-Id: I00adf24213a2e6bf8d148db8375a14200c64ff4f
src/common/include/utils.h
src/common/privilege_db.cpp
src/common/utils.cpp
test/test_misc.cpp