From edfc1409f1b59d49c46b041d8825a5af850d00d9 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Tue, 13 Feb 2001 04:32:00 +0000 Subject: [PATCH] added a note about type generators being a workaround for no templated typedefs [SVN r9185] --- more/generic_programming.html | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/more/generic_programming.html b/more/generic_programming.html index c78c48d58f..a55c41364c 100644 --- a/more/generic_programming.html +++ b/more/generic_programming.html @@ -157,11 +157,11 @@ namespace std {

Type Generators

A type generator is a template whose only purpose is to - synthesize a single new type based on its template argument(s). The - generated type is usually expressed as a nested typedef named, - appropriately type. A type generator is usually used to - consolidate a complicated type expression into a simple one, as in - boost::[1]. The generated type is usually expressed as a + nested typedef named, appropriately type. A type + generator is usually used to consolidate a complicated type + expression into a simple one, as in boost::filter_iterator_generator, which looks something like this: @@ -191,6 +191,7 @@ boost::filter_iterator_generator<my_predicate,my_base_iterator>::type +

Object Generators

An object generator is a function template whose only purpose is @@ -286,6 +287,12 @@ void append_sequence(Container& c, Iterator start, Iterator finish) here. + +

Notes

+ + [1] Type generators are a workaround for the lack + of ``templated typedefs'' in C++. +

Revised