#1336 Use variadic templates (if available) for PushBackTuple and PushFrontTuple
Metadata
Property | Value |
---|---|
Reported by | Oliver Sander (oliver.sander@tu-dresden.de) |
Reported at | Aug 23, 2013 08:35 |
Type | Feature Request |
Version | Git (pre2.4) [autotools] |
Operating System | Unspecified / All |
Last edited by | Oliver Sander (oliver.sander@tu-dresden.de) |
Last edited at | Aug 23, 2013 14:22 |
Closed by | Oliver Sander (oliver.sander@tu-dresden.de) |
Closed at | Aug 23, 2013 14:22 |
Closed in version | Unknown |
Resolution | Implemented |
Comment | Patch committed: 4152f73fcda756d1243f5bb51b050aa9e20408d0 |
Description
The two classes PushBackTuple and PushFrontTuple are both implemented using a long list of template specializations. This makes for a lot of code, and it also limits the maximum tuple size that can be used. Using variadic templates (FYI: available since gcc-4.3) instead allows a generic implementation in only a few lines of code, and only the compiler being the upper limit on tuple size.
An implementation using variadic templates has already been given in the documentation of PushBackTuple/PushFrontTuple. I attach a patch that starts to actually use that implementation, provided that HAVE_VARIADIC_TEMPLATES is set. Otherwise the old implementation is used.
Are there objections to applying the patch?