Version: unspecified (using KDE 4.5.5) OS: unspecified When I create class for C/C++ with Project Manager's "Create Class", it creates header with include guards. But it will be nice, if it will also add pragma once there. Reproducible: Didn't try Steps to Reproduce: Create Class with project manager. Actual Results: Header will look like: #ifndef MAINWINDOW_H #define MAINWINDOW_H class MainWindow { }; #endif // MAINWINDOW_H Expected Results: Will be nice if header will look like: #pragma once #ifndef MAINWINDOW_H #define MAINWINDOW_H class MainWindow { }; #endif // MAINWINDOW_H
Why? Apart from this being _very_ compiler-specific as opposed to the include-guards I don't see a reason for doing both. The compiler that does know pragma's can work just fine with include-guards as well - afaik.
> The compiler that does know pragma's can work just fine with include-guards as well Did not know that. You mean, that all popular compilers (including gcc, vcc etc) support include guards optimisation if they have pragma once support?
I would give the user a choice - whether to use `#pragma once` or `#ifndef / #define` include guards.