How is this any “safer” than #pragma once? What does “safer” mean in this context?On Sat, Mar 22, 2025 at 21:16 Muhammad via Std-Proposals <std-proposals@lists.isocpp.org> wrote:The #include syntax (from cppreference.com)
- # include < h-char-sequence > new-line
- # include " h-char-sequence " new-line
- # include pp-tokens new-line
The pp-tokens in (3) is a macro that get expanded until it matches (1) or (2), and when it doesn't it is undefined behavior.This proposal is to add another syntax for #include
- # include < h-char-sequence > new-line
- # include " h-char-sequence " new-line
- # include once new-line
- # include pp-tokens new-line
The fact that by convention all macros are written in all uppercase pr starts with underscore make this proposal very unlikely to break existing code.The implementation for this proposal is already done using the compiler-specific #pragma once syntax but here it will be more convenient and a standard way to not include it more than once.--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals