[v3] c++0x includes
Douglas Gregor
doug.gregor@gmail.com
Thu Feb 22 07:26:00 GMT 2007
On Feb 21, 2007, at 4:23 AM, Benjamin Kosnik wrote:
> This adds C++0x includes when -std=c++0x.
>
> I'm posting this mostly for feedback, as there are a couple of
> issues that deserve more discussion.
Thanks for doing this!
>
> 3) C++98/C++0x interface issues
>
> a) should C++0x includes warn when included without -std=c++0x, or
> just do nothing?
I expect that C++0x includes may make use of C++0x features not
available without -std=c++0x, so a hard #error might be the right
approach.
> b) what happens when both TR1 and C++0x includes in the same
> translation unit? Ie, for debug mode, we have:
> [snip debug mode]
> But:
>
> #include <tr1/array>
> #include <array>
>
> int main()
> {
> std::array<int, 5> v;
> std::tr1::array<int, 5> v2;
> return 0;
> }
>
> ... are mutually exclusive in this patch.
>
> without -std=c++0x, std::array falls down.
> with -std=c++0x, std::tr1 falls down.
>
> Although this seems like sensible behavior, I thought I'd point it
> out.
If one uses -std=c++0x, and #includes <tr1/array>, does
"std::tr1::array<int, 5> v3;" work? i.e., is TR1 still available in C+
+0x mode?
> ps. FREE THE VARIADIC TEMPLATES
:)
Cheers,
Doug
More information about the Libstdc++
mailing list