Fix moves/forward
Clang has new checks for std::move/std::forward correctness, which
catches quite a few "wrong" things where we were making copies of
callback handlers.
Unfortunately, the lambda syntax of
callback{std::forward<Callback>(callback)}
in a capture confuses it, so change usages to
callback = std::forward<Callback>(callback)
to be consistent.
Tested: Redfish service validator passes.
Change-Id: I7a111ec00cf78ecb7d5f5b102c786c1c14d74384
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/include/dbus_utility.hpp b/include/dbus_utility.hpp
index 933d733..c06ba9e 100644
--- a/include/dbus_utility.hpp
+++ b/include/dbus_utility.hpp
@@ -147,7 +147,7 @@
inline void checkDbusPathExists(const std::string& path, Callback&& callback)
{
crow::connections::systemBus->async_method_call(
- [callback{std::forward<Callback>(callback)}](
+ [callback = std::forward<Callback>(callback)](
const boost::system::error_code& ec,
const dbus::utility::MapperGetObject& objectNames) {
callback(!ec && !objectNames.empty());