Add move constructor for Deck.

This commit is contained in:
Atgeirr Flø Rasmussen 2021-05-10 17:02:01 +02:00
parent 3a4a8c91c6
commit 395bb1ca90
2 changed files with 14 additions and 0 deletions

View File

@ -127,6 +127,7 @@ namespace Opm {
Deck();
Deck( const Deck& );
Deck( Deck&& );
static Deck serializeObject();

View File

@ -159,6 +159,19 @@ namespace Opm {
unit_system_access_count = d.unit_system_access_count;
}
Deck::Deck( Deck&& d ) :
DeckView(d.begin(), d.end()),
keywordList( std::move(d.keywordList) ),
defaultUnits( d.defaultUnits ),
m_dataFile( d.m_dataFile ),
input_path( d.input_path )
{
this->init(this->keywordList.begin(), this->keywordList.end());
if (d.activeUnits)
this->activeUnits = std::move(d.activeUnits);
unit_system_access_count = d.unit_system_access_count;
}
Deck Deck::serializeObject()
{
Deck result;