Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 57458 invoked from network); 23 Jun 2008 15:16:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jun 2008 15:16:05 -0000 Received: (qmail 92725 invoked by uid 500); 23 Jun 2008 15:16:07 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 92661 invoked by uid 500); 23 Jun 2008 15:16:06 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 92650 invoked by uid 99); 23 Jun 2008 15:16:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jun 2008 08:16:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.roguewave.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jun 2008 15:15:17 +0000 Received: from nebula.bco.roguewave.com ([10.70.3.27]) by moroha.roguewave.com (8.13.6/8.13.6) with ESMTP id m5NFFY3e016158 for ; Mon, 23 Jun 2008 15:15:34 GMT Message-ID: <485FBE17.8070901@roguewave.com> Date: Mon, 23 Jun 2008 09:15:35 -0600 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: Inconsistent indentation in preprocessing directives References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Eric Lemings wrote: > > I was just looking at the indentation in the > $TOPDIR/include/rw/_static_assert.h header. Why are the defines within > the `#ifndef _RWSTD_NO_STATIC_ASSERT' indented but the directives > outside this #if/#else/#endif block are not? Should they all be > indented uniformly or not indented at all? I agree it's inconsistent but I'm not sure there is much to be gained from indenting the body of the top level blocks. The purpose of the indentation is to aid readability and Since virtually every header is always enclosed in a pair of #ifdefs, indenting its contents wouldn't do anything to help in this regard. Martin > > I realize this is not conventional but if we want to indent > preprocessing directives, this file should look like this: > > #ifndef _RWSTD_RW_STATIC_ASSERT_H_INCLUDED > # define _RWSTD_RW_STATIC_ASSERT_H_INCLUDED > > # include > > ... > > # ifndef _RWSTD_NO_STATIC_ASSERT > # define _RWSTD_STATIC_ASSERT(Cond) > ... > # else > # define _RWSTD_STATIC_ASSERT(Cond,Mesg) static_assert(Cond, > Mesg) > # endif // _RWSTD_NO_STATIC_ASSERT > > #endif // _RWSTD_RW_STATIC_ASSERT_H_INCLUDED > > Otherwise, we shouldn't indent at all. > > Thanks, > Brad.