From 43a62df9e1742acb6feb48125d11502a646212fb Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 22 Jul 2024 23:32:52 +0200 Subject: [PATCH] added OPERATOR_EQ_IL --- test/common_helper/test.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/common_helper/test.hpp b/test/common_helper/test.hpp index 271b3f0..ffd8746 100644 --- a/test/common_helper/test.hpp +++ b/test/common_helper/test.hpp @@ -263,4 +263,17 @@ inline std::ostream& operator<<(std::ostream& os, ReturnCode rc) { return creator(std::make_index_sequence()); \ }).operator()(il) +#define OPERATOR_EQ_IL(obj, il, len) \ +([&](std::initializer_list args) { \ + auto creator = [&] (std::index_sequence<_idx...>) { \ + return obj = { (*std::next(std::begin(args), _idx))... }; \ + }; \ + return creator(std::make_index_sequence()); \ +}).operator()(il) + +template +constexpr typename std::remove_cvref_t&& force_move(T&& obj) { + return static_cast&&>(obj); +} + #endif //CONST_CONTAINER_TEST_HPP_