diff --git a/include/aidge/utils/DynamicAttributes.hpp b/include/aidge/utils/DynamicAttributes.hpp
index 03513a5d83b98d88ca28393b4612cefd0d9453cc..7e1b465fff5a6af91930841875168a601e81c078 100644
--- a/include/aidge/utils/DynamicAttributes.hpp
+++ b/include/aidge/utils/DynamicAttributes.hpp
@@ -451,10 +451,9 @@ namespace std {
     struct hash<Container<T, Args...>> {
         std::size_t operator()(const Container<T, Args...>& iterable) const {
             std::size_t seed = 0;
-            for (const auto& v : iterable) {
+            for (const typename Container<T, Args...>::value_type& v : iterable) {
                 // Recursively hash the value pointed by the iterator
-                // Use decltype(v) instead of T to make it work for std::map for example.
-                Aidge::hash_combine(seed, std::hash<std::remove_const_t<std::remove_reference_t<decltype(v)>>>()(v));
+                Aidge::hash_combine(seed, std::hash<std::remove_const_t<std::remove_reference_t<typename Container<T, Args...>::value_type>>>()(v));
             }
             return seed;
         }