瀏覽代碼

added a note about type generators being a workaround for no templated
typedefs


[SVN r9185]

Jeremy Siek 25 年之前
父節點
當前提交
edfc1409f1
共有 1 個文件被更改,包括 12 次插入5 次删除
  1. 12 5
      more/generic_programming.html

+ 12 - 5
more/generic_programming.html

@@ -157,11 +157,11 @@ namespace std {
     <h2><a name="type_generator">Type Generators</a></h2>
 
     <p>A <i>type generator</i> 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 <tt>type</tt>. A type generator is usually used to
-    consolidate a complicated type expression into a simple one, as in
-    <tt>boost::<a href=
+    synthesize a single new type based on its template argument(s)<a
+    href="#1">[1]</a>. The generated type is usually expressed as a
+    nested typedef named, appropriately <tt>type</tt>. A type
+    generator is usually used to consolidate a complicated type
+    expression into a simple one, as in <tt>boost::<a href=
     "../libs/utility/filter_iterator.hpp">filter_iterator_generator</a></tt>,
     which looks something like this:
 
@@ -191,6 +191,7 @@ boost::filter_iterator_generator&lt;my_predicate,my_base_iterator&gt;::type
 </pre>
     </blockquote>
 
+
     <h2><a name="object_generator">Object Generators</a></h2>
 
     <p>An <i>object generator</i> is a function template whose only purpose is
@@ -286,6 +287,12 @@ void append_sequence(Container&amp; c, Iterator start, Iterator finish)
     <a href=
     "http://www.cs.rpi.edu/~wiseb/xrds/ovp2-3b.html#SECTION00015000000000000000">
     here</a>.
+
+    <h2>Notes</h2>
+
+    <a name="1">[1]</a> Type generators are a workaround for the lack
+    of ``templated typedefs'' in C++.
+
     <hr>
 
     <p>Revised 

粤ICP备19079148号