Skip to content
Snippets Groups Projects
Commit 4718e4ab authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Added test for move semantics

parent 2b46b05e
No related branches found
No related tags found
No related merge requests found
......@@ -54,3 +54,7 @@
0.000000 0.000000
#! FIELDS time d
0.000000 0.000000
#! FIELDS time d
0.000000 0.000000
#! FIELDS time d
0.000000 0.000000
......@@ -137,13 +137,26 @@ int main(){
testmecpp(p);
}
{
// test move semantics
PLMD::Plumed p;
PLMD::Plumed q(std::move(p));
testmecpp(q);
}
{
PLMD::Plumed p,q;
q=std::move(p);
testmecpp(q);
}
if(PLMD::Plumed::ginitialized()) return 0;
PLMD::Plumed::gcreate();
if(!PLMD::Plumed::ginitialized()) return 0;
// this requires move semantics and only works with C++11
//PLMD::Plumed fromglobal(PLMD::Plumed::global());
PLMD::Plumed fromglobal(PLMD::Plumed::global());
// here's a workaround for plumed 2.3:
PLMD::Plumed fromglobal(plumed_global());
//PLMD::Plumed fromglobal(plumed_global());
testmecpp(fromglobal);
PLMD::Plumed::gfinalize();
if(PLMD::Plumed::ginitialized()) return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment