[Libmesh-devel] UniquePtr for sub_point_locator?

2015-11-24 Thread Derek Gaston
What is the reasoning behind using UniquePtr for the return type from MeshBase::sub_point_locator()? I actually want to store off multiple sub_point_locators and then dish them out to other places as needed inside my code... so I really want to use a std::shared_ptr or at least just a libMesh::Aut

Re: [Libmesh-devel] UniquePtr for sub_point_locator?

2015-11-24 Thread John Peterson
> On Nov 24, 2015, at 5:59 PM, Derek Gaston wrote: > > What is the reasoning behind using UniquePtr for the return type from > MeshBase::sub_point_locator()? > > I actually want to store off multiple sub_point_locators and then dish them > out to other places as needed inside my code... so I

Re: [Libmesh-devel] UniquePtr for sub_point_locator?

2015-11-24 Thread Roy Stogner
On Wed, 25 Nov 2015, Derek Gaston wrote: > What is the reasoning behind using UniquePtr for the return type > from MeshBase::sub_point_locator()? Self-documentation. We allocate it, so someone has to free it. We don't know how long an app is going to use it, so the library can't free it, so th

Re: [Libmesh-devel] UniquePtr for sub_point_locator?

2015-11-24 Thread Derek Gaston
On Tue, Nov 24, 2015 at 11:26 PM Roy Stogner wrote: > We allocate it, so someone has to free it. We don't know how long an > app is going to use it, so the library can't free it, so the app has > to free it. UniquePtr and AutoPtr make that the default behavior, and > so prevent accidental memor