The standard defines headers such as <array>, <regex>, <tuple>, etc. When using std::tr1::array<T, n> the developer must include <tr1/array>. It seems like this is not consistent with the standard which would indicate that <array> is the correct include path. When writing a cross project for GCC / DevStudio the developer is forced to do something like this: #if defined(_MSC_VER) #include <array> #elif defined(__GNUC__) #include <tr1/array> #endif It's ugly! And I suspect that GCC might actually have the wrong include location for std::tr1 headers. The community does not want this kind of difference. Furthermore it is unacceptable to extend the compiler include path with some sort of a -I command line argument because this would simply lead to non-portable build mechanisms. Rather, the problem should be resolved by changing the compiler's internal include path. Thank you. Sincerely, Chris.
This is known. At the right time we debated this issue and in fact some people commented that probably TR1 (n1836) should have more conveniently specified <tr1/*>. In any case, also given the status of TR1 of technical report (*not* standard) on the way of the next (so called C++0x) standard, which is the main focus now, while TR1 is in regression fixes-only mode, we are not going to change the paths now, breaking all *our* existing users. By the way, in C++0x mode, the path is <array>. per the current working drafts.
OK now I understand your strategy. Thanks for the explaination. But there is still a problem in the community. Two very popular compilers (VC and GCC) which are often used in cross development projects together now have different include paths for the C++ tr1 stuff. And it seems like support for tr1 must exist for quite some time until the transition to c++0x is complete. We have discussed this with a few other developers and we wonder if it would be possible to somehow add <tr1> to the include path based on a new compiler switch. Perhaps there could be an additional compiler switch like std=c++98tr1. This would allow for code-compatibility when using tr1 and simultaneously allow the build system to be independent of the compiler location. Could this be considered as a change request? Thank you for your consideration. Sincerely, Chris.
Use -std=c++0x if you want them in the "correct" location. They are only part of the C++0x standard and not part of C++98/03 standards.