|
From: James T. <jam...@kd...> - 2017-05-29 13:23:39
|
> On 29 May 2017, at 13:43, Edward d'Auvergne <tru...@gm...> wrote: > > Is this worth it for _impl if Ephemeris::data() is returning the raw > pointer anyway (for example if modified to return _impl.get()? Yes, absolutely. This is not just about writing less code: when I see in the header, that Ephemeris has a std::unique_ptr<SGEphermeris>, that tells me the class owns the SGEphemeris object. With a raw-pointer, I have to always wonder if the pointer is owning or non-owning. And then when it’s wrong, we get bugs. 90% of the crashes in the AI and related code are because it’s unclear which pointers are owning and non-owning, and reference counting is not used. Kind regards, James |