OPM / opm-parser

http://www.opm-project.org
11 stars 44 forks source link

Returning pointer to a pointer for m_eqldims in TableManager #1172

Closed kel85uk closed 6 years ago

kel85uk commented 6 years ago

In lib/eclipse/EclipseState/Tables/TableManager.cpp

Noticed that the function getEqldims() returns *m_eqldims. Should it be just m_eqldims? This is because it is already of type shared_ptr<Eqldims>?

akva2 commented 6 years ago

it is a function returning a reference so pointer has to be deref'd. what is confusing here ? a shared_ptr pointer follows normal pointer semantics.

kel85uk commented 6 years ago

@akva2 Ah, true that. Thanks for the clarification.

pgdr commented 6 years ago

@kel85uk Thanks for the comment. The underlying problem is that m_eqldims is a shared pointer, and should either have been a value or a unique pointer. Thanks for pointing that out.