I read it was based on Boost's version, but I wasn't quite sure what that meant when it came down to implementation. I know Boost does their own variadic template, but I would assume c++0x would use its own variadic templates for the new tuple.
views:
146answers:
1
+6
A:
The tuple
in the C++0x draft standard uses C++0x variadic templates. It is declared as (§20.4.1):
template <class... Types> class tuple;
Note, however, that the TR1 language extensions also include tuple
, which does not use variadic templates, since there was no such thing when TR1 was written. In TR1, tuple
is declared as (§6.1):
template <class T1 = unspecified ,
class T2 = unspecified ,
...,
class TM = unspecified > class tuple;
where M
is some implementation-defined value that should be at least ten.
TR1 isn't formally a part of the C++ language, but many recent implementations support it. If you have an implementation that doesn't yet support variadic templates, it might support the TR1 tuple
.
You can download the latest draft standard, the Final Committee Draft (10.5 MB PDF link).
James McNellis
2010-08-17 13:08:50
Thanks! That clarifies it. Thanks for the link too.
pheadbaq
2010-08-17 13:25:03