The default constructor and destructor are prototyped as follows:
int MPI::<CLASS>()
int MPI::<CLASS>()
In terms of construction and destruction, opaque MPI-/ user level objects behave like handles. Default constructors for all MPI-/ objects except MPI::Status create corresponding MPI::*_NULL handles. That is, when an MPI-/ object is instantiated, comparing it with its corresponding MPI::*_NULL object will return true. The default constructors do not create new MPI-/ opaque objects. Some classes have a member function Create() for this purpose.
void foo() { MPI::Intracomm bar; if (bar == MPI::COMM_NULL) cout << "bar is MPI::COMM_NULL" << endl; }
The destructor for each MPI-/ user level object does not invoke the corresponding MPI_*_FREE function (if it exists).
void example_function() { MPI::Intracomm foo_comm(MPI::COMM_WORLD), bar_comm; bar_comm = MPI::COMM_WORLD.Dup(); // rest of function }
MPI-Standard for MARMOT