This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: When std::tr1::array and std::array support was released?


Ed Smith-Rowland wrote:
> Mateusz Loskot wrote:
>> Hi,
>>
>> I'm trying to confirm what are the minimum versions of GNU C++ compiler
>> and libstdc++ that bring support of std::tr1::array or std::array.
>> In other words, I develop a software that makes use of array class from
>> TR1 or C++0x and I'd like to document what is minimum requirements of my
>> software that GCC users need to fulfil.
>>
>> I looked at the GCC Changes documents, since 4.1 [1] and I admit I could
>> not find any of these details. The only information I find is the
>> following note:
>>
>> "The implementation status of TR1 is now tracked in the docs
>> in tr1.html."
>>
>> However, the tr1.html document is not linked.
>> I think I found the link [2] but the document is not available and
>> "Not Found" error is returned.
>>
>> I'd appreciate if someone could help me to find it out.
>>
>> [1] http://gcc.gnu.org/gcc-4.1/changes.html
>> [2] http://gcc.gnu.org/onlinedocs/libstdc++/ext/tr1.html
>   
> Greetings,
> 
> The std::tr1::array has been around since 4.0 though that's a pretty old
> version of gcc for other reasons and I'm not sure array was fully
> "baked" there.

Hi Ed,

I see.

> Keep in mind that TR1 is in deep maintenance mode i.e. is deprecated. 
> All new work is in the std.

Yes, I'm aware of it. thanks to Paolo Carlini, I've been educated
about the floating status of TR1 :-)

> I must say though that for array, the implementation is shared for tr1 and std.

Good to know.

> If you need compatibility across both tr1 and std maybe make a define
> for "tr1::" that can be blank in std mode.  This method is used in the
> sources for array and other headers that exist compatibly for both
> std::tr1 and std::.
> 
> I had this in one of my codes for a while:
> #ifdef STD_ARRAY
> # include <array>
> using std::array;
> #elif TR1_ARRAY
> # include <tr1/array>
> using std::tr1::array;
> #else
> #include "my_array.h"
> #endif

That's indeed exactly what I'm trying to hack.

Thanks!

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]