Define destructor in .cpp to avoid defining members

If the compiler is to create the default destructor for us, it will
need the size of the OutputWriter type to be defined at the time of
inclusion in the header. By explicitly defining it in a compilation
unit, we can avoid that.
This commit is contained in:
Roland Kaufmann 2013-11-19 14:43:15 +01:00
parent 3c10785241
commit c896df77cf
2 changed files with 9 additions and 0 deletions

View File

@ -60,6 +60,9 @@ SimulatorOutputBase::SimulatorOutputBase (
writer_->writeInit (*timer);
}
// default destructor is OK, just need to be defined
SimulatorOutputBase::~SimulatorOutputBase() { }
SimulatorOutputBase::operator std::function <void ()> () {
// return (a pointer to) the writeOutput() function as an object
// which can be passed to the event available from the simulator

View File

@ -55,6 +55,12 @@ protected:
std::shared_ptr <BlackoilState> state,
std::shared_ptr <WellState> wellState);
/**
* We need a destructor in the compilation unit to avoid the
* OutputWriter being a complete type here.
*/
virtual ~SimulatorOutputBase ();
/**
* Conversion operator which allows the object to be directly passed
* into an Event and used as a handler.