Merge pull request #419 from blattms/prevent-init-shared_ptr-from-nullptr

Prevents initializing std::shared_ptr from nullptr to suit gcc-4.4
This commit is contained in:
Atgeirr Flø Rasmussen 2015-07-23 23:32:57 +02:00
commit 5b7e1a2e03

View File

@ -69,7 +69,7 @@ struct HelperOps
/// Constructs all helper vectors and matrices. /// Constructs all helper vectors and matrices.
template<class Grid> template<class Grid>
HelperOps(const Grid& grid, Opm::EclipseStateConstPtr eclState = EclipseStateConstPtr (nullptr) ) HelperOps(const Grid& grid, Opm::EclipseStateConstPtr eclState = EclipseStateConstPtr () )
{ {
using namespace AutoDiffGrid; using namespace AutoDiffGrid;
const int nc = numCells(grid); const int nc = numCells(grid);
@ -84,7 +84,8 @@ struct HelperOps
int numNNC = 0; int numNNC = 0;
// handle non-neighboring connections // handle non-neighboring connections
std::shared_ptr<const NNC> nnc = eclState ? eclState->getNNC() : nullptr; std::shared_ptr<const NNC> nnc = eclState ? eclState->getNNC()
: std::shared_ptr<const Opm::NNC>();
const bool has_nnc = nnc && nnc->hasNNC(); const bool has_nnc = nnc && nnc->hasNNC();
if (has_nnc) { if (has_nnc) {
numNNC = nnc->numNNC(); numNNC = nnc->numNNC();