<div dir="auto">Agreed... Anytime you write "new" you probably shouldn't unless you are working with a legacy API.<div dir="auto"><br></div><div dir="auto">Trying to write c++ with a phone sucks...</div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, May 27, 2018, 2:51 PM Mateusz Loskot <<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Sun, 27 May 2018, 23:26 Even Rouault, <<a href="mailto:even.rouault@spatialys.com" target="_blank" rel="noreferrer">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> I'm a bit concerned by all the hidden cost of object duplication with the<br>
> approach I tried. And if you instanciate various projected coordinate<br>
> systems based on the same datum, currently all the datum information would<br>
> be duplicated in each PCS object, whereas with a pointer based approach you<br>
> would have just one instance of it.<br>
> <br>
<br>
I've experienced with the shared_ptr approach in<br>
<a href="https://github.com/rouault/proj.4/commit/85f619cbae7a0b2071681e150f93a5301fa32098" rel="noreferrer noreferrer noreferrer" target="_blank">https://github.com/rouault/proj.4/commit/85f619cbae7a0b2071681e150f93a5301fa32098</a></blockquote></div></div><div dir="auto"><br></div><div dir="auto">std::make_shared is the canonical </div><div dir="auto">and efficient way to manage shared_ptr instances.</div><div dir="auto">The new should be hardly ever needed.</div><div dir="auto"><br></div><div dir="auto">BTW, I've been reading the thread, nothing major to add though - I myself agree with Kurt's points. </div><div dir="auto">For minor points, little point to discuss those and generate unfocused traffic. </div><div dir="auto"><br></div><div dir="auto"><br><span style="font-family:sans-serif">Mateusz Loskot, <a href="mailto:mateusz@loskot.net" target="_blank" rel="noreferrer">mateusz@loskot.net</a></span><br style="font-family:sans-serif"><span style="font-family:sans-serif">(Sent from mobile)</span><br></div><div dir="auto"><br></div></div>
_______________________________________________<br>
Proj mailing list<br>
<a href="mailto:Proj@lists.maptools.org" target="_blank" rel="noreferrer">Proj@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/proj" rel="noreferrer noreferrer" target="_blank">http://lists.maptools.org/mailman/listinfo/proj</a></blockquote></div>