-/* Copyright (c) 2009-2022. The SimGrid Team.
+/* Copyright (c) 2009-2023. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "smpi_info.hpp"
-namespace simgrid{
-namespace smpi{
+namespace simgrid::smpi {
class Op : public F2C{
MPI_User_function* func_;
std::string name_;
public:
- Op(MPI_User_function* function, bool commutative, bool predefined=false, int types=0, std::string name="MPI_Op") : func_(function), is_commutative_(commutative), is_predefined_(predefined), types_(types), name_(name) {if(not predefined) this->add_f();}
+ Op(MPI_User_function* function, bool commutative, bool predefined = false, int types = 0, std::string name = "MPI_Op")
+ : func_(function), is_commutative_(commutative), is_predefined_(predefined), types_(types), name_(std::move(name))
+ {
+ if (not predefined)
+ this->add_f();
+ }
bool is_commutative() const { return is_commutative_; }
bool is_predefined() const { return is_predefined_; }
bool is_fortran_op() const { return is_fortran_op_; }
static void unref(MPI_Op* op);
};
-}
-}
+} // namespace simgrid::smpi
#endif