On Oct 8, 2012, at 5:17 PM, Andrew Haley <a...@redhat.com> wrote: > On 10/06/2012 11:59 AM, _ wrote: >> Not that I think that STL/Boost are not great solutions for many >> problems out there. >> But the fact is that there is and always will be c/c++ code that can't >> and will not use it. > > But surely the set of people refusing to use C++ smart pointers is the > same set that will refuse to use your -fsmart-pointers.
It all boils down whether they are othodox or just simply pragmatic. I am optimist and belive in second :) > >> C or C like templateless C++ code is still domain of most os / >> drivers source code out there. >> Just go agead and try to ask Linus to wrap all pointers to stl >> templates ;D > > And he'd have the same response to -fsmart-pointers. Face it, the > only real differences a compiler builtin would bring are: > > 1. A fossilized "smart pointer type". > 2. A different declaration syntax. Now imagine you have 300 developers with varying experience or ability to work under pressure. You will have 100 libs to manage. And for each lot of patch reviews. Now which way you decide to go Way A: manual cleanup. 30 Proc A { Alloc resource 1 If alloc failed return error Process resource 1 If problem with processing and alloc successfull release resource 1 and exit Alloc 100 different resources } > > Andrew.