1
0
mirror of synced 2024-11-12 02:00:52 +01:00

sys: Fixed broken concept

This commit is contained in:
WerWolv 2021-08-30 19:12:19 +02:00
parent 1a157c7256
commit ef9f0cfca7
2 changed files with 12 additions and 3 deletions

View File

@ -144,5 +144,13 @@ namespace hex {
concept floating_point = std::is_floating_point<T>::value;
}
template<typename T>
struct always_false : std::false_type {};
namespace hex {
template<typename T>
struct always_false : std::false_type {};
template<typename T, size_t Size>
concept has_size = sizeof(T) == Size;
}

View File

@ -9,6 +9,7 @@
#include <hex/views/view.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <hex/helpers/concepts.hpp>
#include <cstring>
#include <codecvt>
@ -22,7 +23,7 @@ namespace hex::lang {
namespace {
template<typename T> requires requires { sizeof(T) == 1; }
template<hex::has_size<1> T>
std::string makeDisplayable(T *data, size_t size) {
std::string result;
for (T* c = data; c < (data + size); c++) {