[v3] Variadic templates, third revision (3/3)

Doug Gregor doug.gregor@gmail.com
Wed Nov 1 16:21:00 GMT 2006

This patch addresses PR c++/20599 by introducing support for variadic


This is the third revision of the variadic templates patch. It
addresses several small bugs, cleans up the terminology used in the
patch, tweaks the syntax slightly, and allows the use of variadic
templates in several more C++ contexts:

  - Base specifier list
  - Throw specifier list
  - Initializer list
  - Base class initializer list

This patch is dependent on the experimental C++0x mode patch, posted here:


More information about variadic templates is available here:


This is part 3 of 3. It contains a changes to libstdc++-v3's TR1 implementation.

Tested on mainline with i686-pc-linux-gnu; no new regressions. All new
tests pass.

Okay for mainline?

	Doug Gregor
	Open Systems Lab @ Indiana University

2006-11-01	Douglas Gregor <doug.gregor@gmail.com>

	* include/Makefile.in: Regenerate.
	* include/tr1/mu_iterate.h: Remove.
	* include/tr1/tuple (_Tuple_impl): New.
	(tuple): Make variadic, re-implement as shell over _Tuple_impl.
	(0-element tuple): Basis case.
	(2-element tuple): Handle pair methods.
	(__get_helper): Remove.
	(tuple_element): Reimplement with variadic templates.
	(tuple_size): Ditto.
	(get): Ditto.
	(operator==): Use variadic templates in the signature.
	(operator<): Ditto.
	(operator!=): Ditto.
	(operator>): Ditto.
	(operator<=): Ditto.
	(operator>=): Ditto.
	(__stripped_tuple_type): Remove; we've inlined its behavior.
	(make_tuple): Reimplement with variadic templates.
	(tie): Ditto.
	* include/tr1/tuple_iterate.h: Remove.
	* include/tr1/bind_repeat.h: Remove.
	* include/tr1/ref_wrap_iterate.h: Remove.
	* include/tr1/bind_iterate.h: Remove.
	* include/tr1/functional (_Weak_result_type): Add variadic
	partial specializations.
	(result_of): Ditto.
	(__invoke): Reimplement using variadic templates.
	(reference_wrapper): Reimplement operator() with variadic
	(_Maybe_unary_or_binary_function): New.
	(_Mem_fn): Implement for member function pointers using variadic
	(placeholders): Define 30 placeholders.
	(_Index_tuple): New.
	(_Build_index_tuple): New.
	(_No_tuple_element): New.
	(_Safe_tuple_element_impl): New.
	(_Safe_tuple_element): New.
	(_Mu): Reimplement with variadic templates, use
	_Safe_tuple_element instead of tuple_element.
	(_Bind): Reimplement with variadic templates and tuples.
	(_Bind_result): Ditto.
	(bind): Reimplement with variadic templates.
	(_Function_handler): Ditto.
	(function): Ditto.
	* include/tr1/functional_iterate.h: Remove.
	* include/tr1/repeat.h: Remove.
	* include/Makefile.am: Don't install removed headers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vt-libstdc++-v3.patch
Type: text/x-patch
Size: 156371 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061101/a996d23e/attachment.bin>

More information about the Gcc-patches mailing list