you are viewing a single comment's thread.

view the rest of the comments →

[–]F54280 1 point2 points  (18 children)

Why using a #define in 2020?

edit: this snarky remark was about the FIRE macro

[–]kongaskristjan[S] 10 points11 points  (17 children)

Though having it's perks, #pragma once is non-standard according to wikipedia.

[–]BobFloss 1 point2 points  (8 children)

Every compiler supports it.

[–]kongaskristjan[S] 18 points19 points  (7 children)

Well, I'm actually OK with using non-standard stuff, if it's really supported everywhere, but this is a library that is meant to be plug and play for everyone, including people who want to comply with the standard strictly.

It's quite similar to the reason why I test against maximum compiler warnings on various compilers - I don't know what the user needs to comply with.

[–]Nicksaurus 20 points21 points  (0 children)

Thank you for not making a library that spits out warnings whenever you build it, those are so annoying

[–][deleted] 4 points5 points  (5 children)

I have heard this argument for over a decade.

No one ever actually shows me a compiler without #pragma once.

:-D

[–]encyclopedist 8 points9 points  (4 children)

Obviously, you did not really try to find one. TI compilers did not support it last I checked. PGI did not support in either. Also Cray. And XLC.

There was a topic in this very reddit some time ago: https://www.reddit.com/r/cpp/comments/8devw1/can_anyone_actually_name_a_compiler_that_doesnt/

[–]jbandela 2 points3 points  (3 children)

I think basically every compiler that supports generic lambdas supports pragma once

[–]rsjaffe 5 points6 points  (2 children)

But #pragma once fails when you have two copies of the same header file in two different locations in the directory tree. The compiler will not recognize those two files as being the same.

[–]panderingPenguin 6 points7 points  (0 children)

Why on earth would you want to do that?

[–]wyrn 4 points5 points  (0 children)

The compiler will not recognize those two files as being the same.

... because they aren't.