If anybody is looking for a fun semi-mindless task to hack on...
run configure with --enable-effective-style
And then start fixing build failures. :)
The flag enables warnings from Scott Meyers’ Effective C++ book:
· Define a copy constructor and an assignment operator
for classes with dynamically allocated memory.
· Prefer initialization to assignment in constructors.
· Make destructors virtual in base classes.
· Have "operator=" return a reference to *this.
· Don’t try to return a reference when you must return
an object.
And from Scott Meyers’ More Effective C++ book:
· Distinguish between prefix and postfix forms of
increment and decrement operators.
· Never overload "&&", "||", or ",".
I gotta say I'd love to have this one on... and it makes me sad to see
the carnage when it's turned on.
If you are new to C++ or are looking to find a good set of
best-practices, the Meyers book is a fairly standard and well regarded
set of them, as should be evidenced by the fact that some of them have
made it in to the GCC warning system. :)
Monty
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp