From 7a11c6c986a3416dba6d1293384b849609697ff2 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Thu, 6 Jun 2019 08:51:46 +0200 Subject: [PATCH] hash --- tests/src/testserver.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/src/testserver.cpp b/tests/src/testserver.cpp index 324582544..c30c6846b 100644 --- a/tests/src/testserver.cpp +++ b/tests/src/testserver.cpp @@ -8,6 +8,15 @@ #include #include "ServerInterface2.h" +struct EnumClassHash +{ + template + std::size_t operator()(T t) const + { + return static_cast(t); + } +}; + using Interface = sls::ServerInterface2; using func_ptr = int (*)(Interface &); @@ -24,7 +33,7 @@ int read_int(Interface &socket) { return 0; } -static std::unordered_map fmap{ +static std::unordered_map fmap{ {func_id::read_data, &read_data}, {func_id::read_int, &read_int}}; int main(int argc, char **argv) {