From ef9f0cfca71fc054546dcc430f4557f4e58d8c19 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 30 Aug 2021 19:12:19 +0200 Subject: [PATCH] sys: Fixed broken concept --- plugins/libimhex/include/hex/helpers/concepts.hpp | 12 ++++++++++-- plugins/libimhex/include/hex/lang/pattern_data.hpp | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/libimhex/include/hex/helpers/concepts.hpp b/plugins/libimhex/include/hex/helpers/concepts.hpp index 5824d36d1..f756e3c6b 100644 --- a/plugins/libimhex/include/hex/helpers/concepts.hpp +++ b/plugins/libimhex/include/hex/helpers/concepts.hpp @@ -144,5 +144,13 @@ namespace hex { concept floating_point = std::is_floating_point::value; } -template -struct always_false : std::false_type {}; \ No newline at end of file +namespace hex { + + template + struct always_false : std::false_type {}; + + template + concept has_size = sizeof(T) == Size; + +} + diff --git a/plugins/libimhex/include/hex/lang/pattern_data.hpp b/plugins/libimhex/include/hex/lang/pattern_data.hpp index 3b6b4dcad..c4d6a1336 100644 --- a/plugins/libimhex/include/hex/lang/pattern_data.hpp +++ b/plugins/libimhex/include/hex/lang/pattern_data.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -22,7 +23,7 @@ namespace hex::lang { namespace { - template requires requires { sizeof(T) == 1; } + template T> std::string makeDisplayable(T *data, size_t size) { std::string result; for (T* c = data; c < (data + size); c++) {