From owner-svn-src-head@FreeBSD.ORG Sat Jul 12 07:30:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F00786E; Sat, 12 Jul 2014 07:30:43 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 24AB92926; Sat, 12 Jul 2014 07:30:43 +0000 (UTC) Received: from [192.168.0.7] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s6C7UX4v041035 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 12 Jul 2014 07:30:34 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268491 - head/usr.bin/users From: David Chisnall In-Reply-To: <201407111726.14347.jhb@freebsd.org> Date: Sat, 12 Jul 2014 08:30:28 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201407101215.s6ACF3v1055260@svn.freebsd.org> <201407111003.57785.jhb@freebsd.org> <12328E44-58A8-4334-A7F4-C7F29C9F6D0E@FreeBSD.org> <201407111726.14347.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Cc: Ed Schouten , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Pietro Cerutti , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 07:30:43 -0000 On 11 Jul 2014, at 22:26, John Baldwin 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=20 > library headers), because it can break large amounts of code. In a = tiny utility, it's probably the right thing to do. >=20 > 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