[Proj] C++ coding practices w.r.t object ownership
schwehr at gmail.com
Sun May 27 17:26:00 EST 2018
Agreed... Anytime you write "new" you probably shouldn't unless you are
working with a legacy API.
Trying to write c++ with a phone sucks...
On Sun, May 27, 2018, 2:51 PM Mateusz Loskot <mateusz at loskot.net> wrote:
> On Sun, 27 May 2018, 23:26 Even Rouault, <even.rouault at spatialys.com>
>> > I'm a bit concerned by all the hidden cost of object duplication with
>> > approach I tried. And if you instanciate various projected coordinate
>> > systems based on the same datum, currently all the datum information
>> > be duplicated in each PCS object, whereas with a pointer based approach
>> > would have just one instance of it.
>> I've experienced with the shared_ptr approach in
> std::make_shared is the canonical
> and efficient way to manage shared_ptr instances.
> The new should be hardly ever needed.
> BTW, I've been reading the thread, nothing major to add though - I myself
> agree with Kurt's points.
> For minor points, little point to discuss those and generate unfocused
> Mateusz Loskot, mateusz at loskot.net
> (Sent from mobile)
> Proj mailing list
> Proj at lists.maptools.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Proj