From 85398a9410a3ab36786c1e436986309ee6163f2f Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 11 Jun 2023 20:20:52 +0200 Subject: c++, codec-json: Added struct to json encoding and fixed a buffer bug on the fly --- src/core/templates.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/core/templates.h') diff --git a/src/core/templates.h b/src/core/templates.h index 6c0a74e..fcac61b 100644 --- a/src/core/templates.h +++ b/src/core/templates.h @@ -53,4 +53,21 @@ struct parameter_key_pack_index { "Provided string_literal doesn't exist in searched list"); }; +template +struct parameter_key_pack_type_helper { + static constexpr string_literal literal = parameter_key_pack_type_helper::literal; +}; + +template +struct parameter_key_pack_type_helper { + static constexpr string_literal literal = Key0; +}; + +template +struct parameter_key_pack_type { + static constexpr string_literal literal = parameter_key_pack_type_helper::literal; + + static_assert(i < sizeof...(Keys), "Provided index is too large in list"); +}; + } -- cgit v1.2.3