Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'issue105' into 'master'
[simgrid.git] / include / xbt / utility.hpp
index cab7266..d0d7302 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2021. The SimGrid Team.
+/* Copyright (c) 2016-2022. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
   static constexpr char const* to_c_str(EnumType value)                                                                \
   {                                                                                                                    \
     constexpr std::array<const char*, _XBT_COUNT_ARGS(__VA_ARGS__)> names{{_XBT_STRINGIFY_ARGS(__VA_ARGS__)}};         \
-    return names[static_cast<int>(value)];                                                                             \
+    return names.at(static_cast<int>(value));                                                                          \
   }                                                                                                                    \
   enum class EnumType { __VA_ARGS__ } /* defined here to handle trailing semicolon */