Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
typo
[simgrid.git] / include / xbt / utility.hpp
index 6a3b542..c35be72 100644 (file)
   }                                                                                                                    \
   static constexpr bool is_valid_##EnumType(int raw_value)                                                             \
   {                                                                                                                    \
-    return raw_value < _XBT_COUNT_ARGS(__VA_ARGS__);                                                                   \
+    return raw_value >= 0 && raw_value < _XBT_COUNT_ARGS(__VA_ARGS__);                                                 \
   }                                                                                                                    \
   enum class EnumType { __VA_ARGS__ } /* defined here to handle trailing semicolon */
 
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
 
 /** @brief Replacement for C++20's std::type_identity_t
  */
@@ -80,6 +79,5 @@ template <class List, class Elem> inline void intrusive_erase(List& list, Elem&
   list.erase(list.iterator_to(elem));
 }
 
-} // namespace xbt
-} // namespace simgrid
+} // namespace simgrid::xbt
 #endif