Use of angle brackets around file names for include statements
Would you like to replace any double quotes by angle brackets around file names for include statements?
Could you please explain why you think that the angle brackets are preferable? Sorry, but from link you provided I didn't find a clean answer. I know that some times using angle brackets on non compiler specific headers leads to problems, because 3rd party library is not added to compiler include paths.
I suggest to reconsider the consequences of the following wording from the section "16.2 Source file inclusion" in the standard specification for the programming language "C++".
…
The named source file is searched for in an implementation-defined manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it read
#include <h-char-sequence> new-line
…
- How do you think about to avoid "a duplicated file search" here?
- Would you like to restrict the searched directories for header files of your software?
Sorry, but I'm again missed the sense of using angle brackets for user libraries. As I understand using angle bracket can prevent situation of loading user header instead of system header if their names are the same (but it can hide a real problem). Personally I never met situations when 3rd party libraries are placed some where in the system, usually they placed in same code base with main project. Because in such case you can guarantee that the version of 3rd party library will be not changed independently from main project.
There are different opinions about the handling of the involved implementation-defined behaviour.
- Will header files be also searched outside the specified include directories if double quotes are used for the discussed preprocessor statement?
- Is there a speed difference measurable if a file is not found there and the search will be retried with "the angle brackets inclusion method"?