From eddd96901e76811850b63d8bc2cd1690153f38ce Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 17 Nov 2010 19:47:20 +0000 Subject: [PATCH] add some justification for "using namespace llvm;" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119544 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CodingStandards.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html index 011ac981009..22a29427ce8 100644 --- a/docs/CodingStandards.html +++ b/docs/CodingStandards.html @@ -914,11 +914,13 @@ such, we never use 'using namespace std;' in LLVM.

The exception to the general rule (i.e. it's not an exception for the std namespace) is for implementation files. For example, all of the code in the LLVM project implements code that lives in the 'llvm' namespace. -As such, it is ok, and actually clearer, for the .cpp files to have a 'using -namespace llvm' directive at their top, after the #includes. The -general form of this rule is that any .cpp file that implements code in any -namespace may use that namespace (and its parents'), but should not use any -others.

+As such, it is ok, and actually clearer, for the .cpp files to have a +'using namespace llvm' directive at their top, after the +#includes. This reduces indentation in the body of the file for source +editors that indent based on braces, and keeps the conceptual context cleaner. +The general form of this rule is that any .cpp file that implements +code in any namespace may use that namespace (and its parents'), but should not +use any others.