X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/149c63f36e15b8500b1e826bda5138318ff7ba2b..a09110fd2917c2121b096754868decbfd6582866:/include/xbt/automaton.hpp diff --git a/include/xbt/automaton.hpp b/include/xbt/automaton.hpp index 58fdd7553c..8c4ac2e9b5 100644 --- a/include/xbt/automaton.hpp +++ b/include/xbt/automaton.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2020. The SimGrid Team. +/* Copyright (c) 2015-2022. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -21,13 +21,9 @@ namespace xbt { */ template xbt_automaton_propositional_symbol_t add_proposition(const_xbt_automaton_t a, const char* id, F f) { - F* callback = new F(std::move(f)); + 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; }); } }