Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Replace "std::function" by a template parameter.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 3 Jul 2019 12:31:35 +0000 (14:31 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 3 Jul 2019 12:31:35 +0000 (14:31 +0200)
src/smpi/internals/smpi_global.cpp

index c7ab73e..0b497fb 100644 (file)
@@ -421,8 +421,8 @@ typedef std::function<int(int argc, char *argv[])> smpi_entry_point_type;
 typedef int (* smpi_c_entry_point_type)(int argc, char **argv);
 typedef void (*smpi_fortran_entry_point_type)();
 
 typedef int (* smpi_c_entry_point_type)(int argc, char **argv);
 typedef void (*smpi_fortran_entry_point_type)();
 
-static int smpi_run_entry_point(const smpi_entry_point_type& entry_point, const std::string& executable_path,
-                                std::vector<std::string> args)
+template <typename F>
+static int smpi_run_entry_point(const F& entry_point, const std::string& executable_path, std::vector<std::string> args)
 {
   // copy C strings, we need them writable
   std::vector<char*>* args4argv = new std::vector<char*>(args.size());
 {
   // copy C strings, we need them writable
   std::vector<char*>* args4argv = new std::vector<char*>(args.size());