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:
parent
3c10785241
commit
c896df77cf
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user