From 58d698bb82c3b91fc7fbe949cc42af51cf9adae5 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Tue, 25 Jun 2024 21:55:38 +0000 Subject: [PATCH] Specialize Attributes size() function for EnumString struct --- include/aidge/utils/Attributes.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/aidge/utils/Attributes.hpp b/include/aidge/utils/Attributes.hpp index 05514f011..dde1e7d4e 100644 --- a/include/aidge/utils/Attributes.hpp +++ b/include/aidge/utils/Attributes.hpp @@ -12,7 +12,6 @@ #ifndef AIDGE_CORE_UTILS_ATTRIBUTES_H_ #define AIDGE_CORE_UTILS_ATTRIBUTES_H_ -#include <vector> #include <string> #include <set> @@ -36,6 +35,9 @@ namespace Aidge { template<class T, std::size_t N> constexpr std::size_t size(T (&)[N]) { return N; } +template<std::size_t N> +constexpr std::size_t size(const char* const (&)[N]) { return N; } + /* This abstract class allows to avoid binding Attributes. * Otherwise we would need to bind every template possible of Attributes. * Every operators can access the methods of this class by inheriting from -- GitLab