|
|
Subscribe / Log in / New account

The coding standards are the least of your worries!

The coding standards are the least of your worries!

Posted Jun 2, 2010 18:27 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
In reply to: The coding standards are the least of your worries! by Ed_L.
Parent article: GCC begins move to C++

This is exceedingly bad design. Any good C++ programmer will write:

std::auto_ptr<C_BAR> bar(new C_Bar());

...or something like it. It's exception- and leak-proof.

In one of my projects we had a 'no naked new' rule. So the result of EACH 'new' must be wrapped in a smart pointer (there were only a few carefully audited places where this policy was relaxed). Worked wonders.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds