svn commit: r268491 - head/usr.bin/users

David Chisnall theraven at FreeBSD.org
Sat Jul 12 07:30:43 UTC 2014


On 11 Jul 2014, at 22:26, John Baldwin <jhb at FreeBSD.org> wrote:

>> For things that live in the base system, there's not much danger of boost conflicts.  'using namespace std' is mostly a problem when it's in headers (especially 
> library headers), because it can break large amounts of code.  In a tiny utility, it's probably the right thing to do.
> 
> The original question was about a general style rule for C++ code in FreeBSD.
> I suppose it would be fine to permit it in small utilities and only in .cc
> files but not otherwise?

I would say that it's completely fine as long as:

- It's in an implementation file and
- The utility has not dependencies other than the standard library

The first ensures that namespace pollution is localised.  The latter limits you to cases where there is no chance of there being any conflicts (if you're defining a symbol in a program that has the same name as an STL one then you should probably be referring to it by its fully qualified name anyway or the code will be unreadable).

David



More information about the svn-src-all mailing list