220 14125 <CANPtknx-D2wnznu3dnt_F8T-UowTh=wdn3q7rwboaS6ZGDmKmw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Peter Koch Larsen <peter.koch.larsen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: #pragma once
Date: Wed, 22 Oct 2014 17:45:24 +0200
Lines: 39
Approved: news@gmane.org
Message-ID: <CANPtknx-D2wnznu3dnt_F8T-UowTh=wdn3q7rwboaS6ZGDmKmw@mail.gmail.com>
References: <3d0ab5b0-73d9-434a-9ae4-cd47d8275590@isocpp.org>
	<11313423.lvzWu67DM3@tjmaciei-mobl4>
	<CANPtknxEuDw=n4NoJiYKDH74kBbh=O_dvLgkGHJ-iS6b_eT+Cg@mail.gmail.com>
	<4406713.Mls04kbNJi@tjmaciei-mobl4>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1413992733 17422 80.91.229.3 (22 Oct 2014 15:45:33 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 22 Oct 2014 15:45:33 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDRIBXXKZQERBFNCT6RAKGQEGY3QSFY@isocpp.org Wed Oct 22 17:45:27 2014
Return-path: <std-proposals+bncBDRIBXXKZQERBFNCT6RAKGQEGY3QSFY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-la0-f71.google.com ([209.85.215.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDRIBXXKZQERBFNCT6RAKGQEGY3QSFY@isocpp.org>)
	id 1Xgy6I-0005dc-Fh
	for gclcip-std-proposals@m.gmane.org; Wed, 22 Oct 2014 17:45:26 +0200
Original-Received: by mail-la0-f71.google.com with SMTP id gi9sf2211433lab.6
        for <gclcip-std-proposals@m.gmane.org>; Wed, 22 Oct 2014 08:45:26 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=pBzWxFQzSbbcmTv3Cedkw56nu9bAVSE7XlZPnY/KWz0=;
        b=IENZWwM7nhkpxTr3Kn9pPdZYbf91tWbCFMB/LWRqLHtj6VEgtETuOKihHkCCV6QtcB
         TwMimhVnEYgcarZj7V4Em00/k6mV8zKzGEt1Fi0LkbifKakx9XOJ8f/9gYeYFu4TVio9
         zJ4wA6JNY19ccAJN5VMALzpuISkEWF6g6MweylYbgYe9ZTEn11MasI9rWwqFjPEaOawK
         6cesD4h92MxWT9L//niYBnMDznmZEAI6dyaFZk3kLJ1YI6GzesufhagDuRLhTiekpSUW
         1P17406193xnSdzmshSyzCCdZWInmYU8PNb900SWYmoNY9nW9HplA4RhcnOYT93GloD2
         Wadg==
X-Gm-Message-State: ALoCoQlf5sokreHHZ4Cep/kpIRPFWFQqYhcN/oqZaV6d5QpFJbvw4fCMwA5jTU90c2d3/F4VkGAR
X-Received: by 10.112.163.229 with SMTP id yl5mr76393lbb.23.1413992726223;
        Wed, 22 Oct 2014 08:45:26 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.199.38 with SMTP id jh6ls214548lac.9.gmail; Wed, 22 Oct
 2014 08:45:24 -0700 (PDT)
X-Received: by 10.112.132.34 with SMTP id or2mr10775484lbb.75.1413992724844;
        Wed, 22 Oct 2014 08:45:24 -0700 (PDT)
Original-Received: from mail-la0-x230.google.com (mail-la0-x230.google.com. [2a00:1450:4010:c03::230])
        by mx.google.com with ESMTPS id bm5si7264470lbb.59.2014.10.22.08.45.24
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 22 Oct 2014 08:45:24 -0700 (PDT)
Received-SPF: pass (google.com: domain of peter.koch.larsen@gmail.com designates 2a00:1450:4010:c03::230 as permitted sender) client-ip=2a00:1450:4010:c03::230;
Original-Received: by mail-la0-f48.google.com with SMTP id gi9so3124919lab.21
        for <std-proposals@isocpp.org>; Wed, 22 Oct 2014 08:45:24 -0700 (PDT)
X-Received: by 10.112.200.34 with SMTP id jp2mr42570260lbc.1.1413992724741;
 Wed, 22 Oct 2014 08:45:24 -0700 (PDT)
Original-Received: by 10.152.162.104 with HTTP; Wed, 22 Oct 2014 08:45:24 -0700 (PDT)
In-Reply-To: <4406713.Mls04kbNJi@tjmaciei-mobl4>
X-Original-Sender: peter.koch.larsen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of peter.koch.larsen@gmail.com designates 2a00:1450:4010:c03::230 as
 permitted sender) smtp.mail=peter.koch.larsen@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:14125
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14125>

On Wed, Oct 22, 2014 at 4:52 PM, Thiago Macieira <thiago@macieira.org> wrote:
> On Wednesday 22 October 2014 12:39:15 Peter Koch Larsen wrote:
<snip>
>> I agree with Thiago. Even if both my compilers support the once pragma
>> I stick to include guards. They work if you provide a meaningful name
>> (I include my initials and the date of construction so something like
>> ... _PKL_2014_10_22). I believe it would save me sixty seconds to
>> write #pragma instead.
>> If include guards make your compilation slow, you should complain to
>> your vendor.
>
> Just out of curiosity, why does it need to be that complex?

You mean why I add my initials and a date? It is in my fingers - perhaps that is
the best answer. But if you include stuff from others and they are not
as rigoreous
as e.g. boost, there is a risk that a "FORMAT_HPP" is not unique. I have been
bitten by that once - even if it was a very long time ago.

/Peter
>
> The include guard can be based on a rule of formation based on how the header
> itself gets #included. You can't have two of such files getting included in the
> same translation unit anyway.
You mean something like BOOST_DETAILS_LEXICAL_CAST? You could also do
that (I am not sure this is a proper boost macro, btw). But I know
that I never create
two include-files on the same day with the same name.

/Peter

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
