On Tuesday 19 of March 2013, Thomas Arnhold wrote:
On 19.03.2013 00:02, Norbert Thiebaud wrote:
otoh, #pragma once is supported by all the compiler we use isn't it ?
so if we are going to change it, why not use that instead.
There are some discussions about that on the Internet. Most interesting:
Some kind of benchmark comparison at
http://tinodidriksen.com/2011/08/31/cpp-include-speed/
Looks like header guards as we have them are the best solution on gcc,
but the worst for MSVC and no combination would be acceptable compared
to 'plain' header guard with gcc.
That's so suspicious just from considering the idea that there could possibly
be any noticeable difference. I can't quite imagine how broken the
implementation of #pragma once would have to be to be slower than include
guards (and presumably they're both implemented the same way). I tried with
10000 include files with GCC and the difference, if any, is just lost in the
noise.
--
Lubos Lunak
l.lunak@suse.cz
Context
- Re: #ifdef vs #if for feature checks (continued)
Re: #ifdef vs #if for feature checks · Norbert Thiebaud
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.