From e29db0fa876b7dd55183387fc74864eb8c377fa8 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 3 Nov 2019 22:37:19 +0100 Subject: [PATCH] Prevent warnings about unused lambda captures --- lib/binary/reflector.h | 2 ++ lib/json/reflector.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/lib/binary/reflector.h b/lib/binary/reflector.h index 50026e9..8022fc8 100644 --- a/lib/binary/reflector.h +++ b/lib/binary/reflector.h @@ -270,6 +270,8 @@ template > *> void BinarySeriali [this](const auto &valueOfActualType) { if constexpr (!std::is_same_v, std::monostate>) { write(valueOfActualType); + } else { + CPP_UTILITIES_UNUSED(this) } }, variant); diff --git a/lib/json/reflector.h b/lib/json/reflector.h index e1f1a9b..75979eb 100644 --- a/lib/json/reflector.h +++ b/lib/json/reflector.h @@ -9,6 +9,8 @@ #include "../traits.h" +#include + #include #include #include @@ -289,6 +291,9 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ [&data, &allocator](const auto &reflectableOfActualType) { if constexpr (!std::is_same_v, std::monostate>) { push(reflectableOfActualType, data, allocator); + } else { + CPP_UTILITIES_UNUSED(data) + CPP_UTILITIES_UNUSED(allocator) } }, reflectable);