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

看板FB_svn作者時間11年前 (2014/07/12 15:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串25/30 (看更多)
On 11 Jul 2014, at 22:26, John Baldwin <jhb@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 _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
文章代碼(AID): #1JmEHo5f (FB_svn)
討論串 (同標題文章)
文章代碼(AID): #1JmEHo5f (FB_svn)