220 29164 <39942871.2nODYZUWSR@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: pragma once
Date: Thu, 27 Oct 2016 14:02:35 -0700
Lines: 30
Approved: news@gmane.org
Message-ID: <39942871.2nODYZUWSR@tjmaciei-mobl1>
References: <CAGz9X0c=CNLVEGgJ7=GJ2W+7fsvN7h+tbiFyf5Cx3aab0Xb=rQ@mail.gmail.com> <47276183-8ce7-4999-ab1c-4be1cbaf26bb@isocpp.org> <CAA7YVg1LZYYgzH0OqWrMAXMtQFkX_xsYfx0=qcuYbyRoLEhBoQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: blaine.gmane.org 1477602193 30437 195.159.176.226 (27 Oct 2016 21:03:13 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 27 Oct 2016 21:03:13 +0000 (UTC)
User-Agent: KMail/5.3.2 (Linux/4.8.3-1-default; KDE/5.26.0; x86_64; ; )
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRB3WWZHAAKGQEV3I7SUI@isocpp.org Thu Oct 27 23:03:07 2016
Return-path: <std-proposals+bncBCB4TK757YBRB3WWZHAAKGQEV3I7SUI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f70.google.com ([74.125.82.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRB3WWZHAAKGQEV3I7SUI@isocpp.org>)
	id 1bzroq-0003hj-9P
	for gclcip-std-proposals@m.gmane.org; Thu, 27 Oct 2016 23:02:36 +0200
Original-Received: by mail-wm0-f70.google.com with SMTP id m83sf18044186wmc.1
        for <gclcip-std-proposals@m.gmane.org>; Thu, 27 Oct 2016 14:02:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:user-agent:in-reply-to:references
         :mime-version:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=huFOjOmI9GoehKdDD3IryAJiGWQppaMwK+0jUvvek6o=;
        b=X1VzJ9wtUgWtRYcgGA8fb5eUc7p+T+hdxkeVpEZKunzDuW6qoZJgp6DCdWc9mlBp7e
         GHFbu8Xq4rq5lWEgFWa1FEbTM6mKfbqZx7udB4toLPVMzBu+T9QFYvtjpECQd/wwtEXh
         ONiFBOuz+/IeFWmgtKGd2X5St+/X0igWTYW4JBwDTMhW0WcfpBvPZiK5MMPwd9klTdKu
         Vs8fPmFZ3e7pwECs0VaedthqeP4hTLYmb1sS+KDVlTsxozykBgxWO3O7l7TdyIpe7OG4
         7ZONicnariQ5st5k4SCuwc6F+JQuc6fnLv/4hGgHvzkNxeDocyW2p4VTE4J4gcadYNkd
         xu0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=huFOjOmI9GoehKdDD3IryAJiGWQppaMwK+0jUvvek6o=;
        b=iEnT7dOKoStv8thzajkVakidUOXWJdUkZDuCBPFa6es82hDEI9yffX1td8pkhVocdc
         jzZQMrl6FqWRmGkssEAGjtZq2VGKO/WFLerjNudO7sYttisx/REnh83kOFs4/l079yoX
         g9BvmBfD1HSney51RYBhCAVp/ttuG/BOBAXRw3vRHhbKRwm8Cx33KN2sUXxFkPWsjSja
         AS9xuRdgj5aaxw5QPc6UPWU+DQl7y11SlIl6YhvyfRJyCek4c3puawlxaiXlvabD9vD2
         Mo5qq8PZ9ZsdjXYEoHJckDSB4DtKuzStopXT6dRb8gobjpg52me33KfuIoEinDHmnZeu
         90og==
X-Gm-Message-State: ABUngveiUjFEYdKHkABgoqvyw2QOzn9ietG/TcvjUpl/oIlmnBprvDBeQKQus3HcAMgkJw==
X-Received: by 10.28.198.130 with SMTP id w124mr73642wmf.6.1477602159040;
        Thu, 27 Oct 2016 14:02:39 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.29.147 with SMTP id d141ls96021wmd.3.gmail; Thu, 27 Oct
 2016 14:02:37 -0700 (PDT)
X-Received: by 10.194.104.40 with SMTP id gb8mr8568796wjb.28.1477602157894;
        Thu, 27 Oct 2016 14:02:37 -0700 (PDT)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id s10si5544017wmb.142.2016.10.27.14.02.37
        for <std-proposals@isocpp.org>;
        Thu, 27 Oct 2016 14:02:37 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl1.localnet (jfdmzpr02-ext.jf.intel.com [134.134.137.71])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 7038811AEA3
	for <std-proposals@isocpp.org>; Thu, 27 Oct 2016 14:02:37 -0700 (PDT)
In-Reply-To: <CAA7YVg1LZYYgzH0OqWrMAXMtQFkX_xsYfx0=qcuYbyRoLEhBoQ@mail.gmail.com>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mailfrom=thiago@macieira.org
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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:29164
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29164>

On quarta-feira, 26 de outubro de 2016 18:44:19 PDT Viacheslav Usov wrote:
> #pragma once(SOME_GUARD_SYMBOL) is equivalent to having used
> SOME_GUARD_SYMBOL as an include guard.
> 
> Granted, this is not as succinct as #pragma once, but it still has the
> benefit of specifying the include guard symbol just in one place, thus
> eliminating the possibility of mistakes like
> 
> #ifndef  SOME_GUARD_SYMBOL
> #define SAME_GUARD_SYMBOL
> #endif  // SUM_GUARD_SYMBOL

The comment on the endif is irrelevant. The #ifndef/#define problem is highly 
unlikely ever since Copy & Paste was invented.

So, yes, there is a benefit of #pragma once with a guard symbol that you define, 
but it's very minimal because it doesn't solve the real problem that guard 
macros have, namely that of clashes between libraries. It only saves you some 
typing.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/39942871.2nODYZUWSR%40tjmaciei-mobl1.

.
