Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change most mcmini tests to odpor reduction; the unchanged one fails to find the...
[simgrid.git] / include / xbt / automaton.hpp
index b9bea1e..18a7d6b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2020. The SimGrid Team.
+/* Copyright (c) 2015-2023. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -11,8 +11,7 @@
 
 #include <xbt/automaton.h>
 
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
 
 /** Add a proposition to an automaton (the C++ way)
  *
@@ -23,13 +22,8 @@ template <class F> xbt_automaton_propositional_symbol_t add_proposition(const_xb
 {
   auto* callback = new F(std::move(f));
   return xbt_automaton_propositional_symbol_new_callback(
-    a, id,
-    [](void* callback) -> int { return (*(F*)callback)(); },
-    callback,
-    [](void* callback) -> void { delete (F*)callback; }
-  );
+      a, id, [](auto* cb) -> int { return (*(F*)cb)(); }, callback, [](auto* cb) -> void { delete (F*)cb; });
 }
 
-}
-}
+} // namespace simgrid::xbt
 #endif