[Development] #pragma once

Ville Voutilainen ville.voutilainen at gmail.com
Thu Jan 25 11:38:49 CET 2018


On 25 January 2018 at 12:31, Konstantin Tokarev <annulen at yandex.ru> wrote:
>
>
> 25.01.2018, 13:27, "Mathias Hasselmann" <mathias at taschenorakel.de>:
>> Let's see what people who know much more about compiler features than
>> any of us think about "#pragma once". Let's check what GCC and Clang do
>> for their C++ library headers:
>>
>>    $ grep -r pragma.*once /usr/include/clang/5.0.0/include
>> /usr/include/c++/7.2.0/
>>    $
>>
>> ...and this is about headers that target exactly one compiler and are
>> known to be locally installed.
>
> The latter statement is not exactly true, both libstdc++ and libc++ can be used
> by many compilers, and they also aren't guaranteed to be locally installed.


Correct. Both of those libraries make an effort to work with both gcc
and clang, and to some extent
EDG, and multiple versions thereof. However, that finding is
interesting, but still anecdotal, and I doubt the
suggestion of "people who know much more about compiler features than
any of us" is entirely
accurate in my case. :P



More information about the Development mailing list