Dear Wiki user, You have subscribed to a wiki page or wiki category on "Stdcxx Wiki" for change notification.
The following page has been changed by EricLemings: http://wiki.apache.org/stdcxx/Cpp0x The comment on the change is: Updated with latest progress. Added some additional implementation notes. ------------------------------------------------------------------------------ = Tuples = - Tuples are basically the same thing as {{{std::pair}}} except that tuples have a variable number of type parameters (or an implementation-defined number of parameters with default types) . The class template and associated {{{std}}} namespace members are sufficiently simple enough so that two implementations -- one for compilers that support variadic templates and another for all other compilers that don't -- can be written at the same time. + Tuples are basically the same thing as {{{std::pair}}} except that tuples have a variable number of type parameters (or an implementation-defined number of parameters with default types) . The class template and associated {{{std}}} namespace members are sufficiently simple enough so that two implementations -- one for compilers that support variadic templates and another for all other compilers that don't -- can be written at the same time. Due to resource constraints however, only the variadic templates version will be implemented initially. The specification for tuples in the latest draft standard also assumes variadic templates. Consequently, a tuple implementation that does not utilize variadic template would be considered a library extension. - A couple of things to take into consideration however. Tuples can have no type parameters; e.g., {{{std::tuple<>}}} is a valid type. Consequently, this particular tuple type should have no constructors that accept (or other members that operate on) any values (other than the value of the tuple itself). + Tuples can have no type parameters; e.g., {{{std::tuple<>}}} is a valid type. Consequently, this particular tuple type should have no constructors that accept (or other members that operate on) any values (other than the value of the tuple itself). Tuples with exactly two type parameters have conditional constructors and operators for conversions from values of the {{{std::pair}}} class template. This means the class template needs to be specialized when instantiated with exactly two types to define the additional members. + + == Issues == + + The current implementation places the {{{std::tuple}}} class template in the {{{<rw/_tuple.h>}}} header file. I'm not convinced that an internal tuple, i.e. {{{_RW::__rw_tuple}}}, is needed though if so, it would be placed in this header and the standard tuple would be moved out of this header into the standard {{{<tuple>}}} header. (That's a lot of essentially duplicated constructors due to three different tuples -- one internal tuple, one standard generic tuple, and one standard pair tuple -- if this proves to be the case.) Should probably also move the internal {{{__rw}}} namespace members from the standard {{{<tuple>}}} header to the internal header. + + The tuple specialization for two element types is currently essentially a duplicate of {{{std::pair}}}. This might not be the most appropriate solution (due to additional helper specializations) and may prove that the internal tuple mentioned above really is needed. + + The tuple_cat() function overloads are REALLY tricky to implement. = Online Resources =
