Why isn't C/C++'s “#pragma once” an ISO standard?

前端 未结 9 1681
说谎
说谎 2020-11-28 11:29

I am currently working on a big project and maintaining all those include guards makes me crazy! Writing it by hand is frustrating waste of time. Although many editors can g

9条回答
  •  抹茶落季
    2020-11-28 12:24

    You can probably avoid name collisions without resorting to random strings by setting the include guard to contain the name of the class and namespace that's in the file.

    Besides, #pragma once is supported by both MS compilers and GCC for quite some time now so why does it bother you that it's not on the ISO standard?

提交回复
热议问题