diff --git a/iterator_adaptors.htm b/iterator_adaptors.htm index 531bef9..aa3c42a 100644 --- a/iterator_adaptors.htm +++ b/iterator_adaptors.htm @@ -131,11 +131,11 @@

iterator_adaptor is declared like this:

 template <class Base, class Policies, 
-    class ValueOrNamedParams = typename std::iterator_traits<Base>::value_type,
-    class ReferenceOrNamedParams = ...(see below),
-    class PointerOrNamedParams = ...(see below),
-    class CategoryOrNamedParams = typename std::iterator_traits<Base>::iterator_category,
-    class DistanceOrNamedParams = typename std::iterator_traits<Base>::difference_type>
+    class ValueOrNamedParam = typename std::iterator_traits<Base>::value_type,
+    class ReferenceOrNamedParam = ...(see below),
+    class PointerOrNamedParam = ...(see below),
+    class CategoryOrNamedParam = typename std::iterator_traits<Base>::iterator_category,
+    class DistanceOrNamedParam = typename std::iterator_traits<Base>::difference_type>
 struct iterator_adaptor;
 
@@ -208,11 +208,9 @@ struct iterator_adaptor; std::iterator_traits<BaseType>::difference_type - NamedParams + NamedParam - A list of named template parameters generated using the - - iterator_traits_generator class (see below). + A named template parameter (see below).

Named Template Parameters

@@ -223,59 +221,32 @@ struct iterator_adaptor; template parameter, but use the defaults for the third through fifth. As a solution to these problems we provide a mechanism for naming the last five template parameters, and providing them in - any order through the iterator_traits_generator class. - + any order through a set of named template parameters. The following + classes are provided for specifying the parameters. Any of these + classes can be used for any of the last five template parameters + of iterator_adaptor.
-class iterator_traits_generator
-{
-public:
-  template <class Value>
-  struct value_type : public recursive magic { };
-
-  template <class Reference>
-  struct reference : public recursive magic { };
-
-  template <class Pointer>
-  struct pointer : public recursive magic { };
-
-  template <class Distance>
-  struct difference_type : public recursive magic { };
-
-  template <class Category>
-  struct iterator_category : public recursive magic { };
-};
+template <class Value> struct value_type_is;
+template <class Reference> struct reference_is;
+template <class Pointer> struct pointer_is;
+template <class Distance> struct difference_type_is;
+template <class Category> struct iterator_category_is;
 
- The iterator_traits_generator is used to create a list of - of template arguments. For example, suppose you want to set the - Reference and Category parameters, and use the - defaults for the rest. Then you can use the traits generator as - follows: + For example, the following adapts foo_iterator to create + an InputIterator + with reference type foo, and whose other traits + are determined according to the defaults described above.
-iterator_traits_generator::reference<foo>::category<std::input_iterator_tag>
-
-
- - This generated type can then be passed into the iterator_adaptor - class to replace any of the last five parameters. If you use the traits - generator in the ith parameter position, then the parameters i - through 7 will use the types specified in the generator. For example, the - following adapts foo_iterator to create an InputIterator with - reference type foo, and whose other traits are determined - according to the defaults described above. - -
-
-iterator_adaptor<foo_iterator, foo_policies,
-    iterator_traits_generator
-    ::reference<foo>
-    ::iterator_category<std::input_iterator_tag>
->
+typedef iterator_adaptor<foo_iterator, foo_policies,
+  reference_is<foo>, iterator_category_is<std::input_iterator_tag>
+  > MyIterator;