Jay Pipes wrote:
> Hi all,
> 
> Monty recently brought up a good discussion/vote point on a merge
> proposal from Padraig, and I think I like his idea.  Just want to get
> everyone's opinion on this and then we can add it to the style
> guidelines online...
> 
> Basically, the rule would be:
> 
> When in a *header file*, always use an explicit namespace prefix, like so:
> 
> void myfunc(std::list some_list, drizzle::serialize::Table *some_table)
> {
>   // blah, blah...
> }

The bit above is the important one. Use of using inside of header files
can make thing more ambiguous as to what the interface really is, and
can also inject unintended name resolution changes into including files.

> and in implementation files, use a single using namespace statement,

_after_ all include statements, so as not to inject un-intended name
resolution issues into headers.

> like so:
> 
> using namespace std;
> using namespace drizzle::serialize;
> 
> void myfunc(list some_list, Table some_table)
> {
>   // blah, blah
> }
> 
> Opinions?

This one isn't _required_, although I'd like to adopt it anyway. Mainly
- we've got using statements, implementation files aren't included
elsewhere (at least, not any more thankfully) so we know what's going on
in them... so the code is hella-friendlier that way.

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

Reply via email to