From 6f59ef904b8467f0878aba953bcc933fac376af7 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 28 Jul 2005 18:22:23 +0000 Subject: [PATCH] Revert Jeremy Siek's patches for now [SVN r30299] --- include/boost/concept_archetype.hpp | 7 +++---- stl_concept_covering.cpp | 26 ++++++++++++++++---------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/include/boost/concept_archetype.hpp b/include/boost/concept_archetype.hpp index e020dd7..f21c817 100644 --- a/include/boost/concept_archetype.hpp +++ b/include/boost/concept_archetype.hpp @@ -408,7 +408,7 @@ namespace boost { //=========================================================================== // Iterator Archetype Classes - template > + template class input_iterator_archetype { private: @@ -416,8 +416,7 @@ namespace boost { public: typedef std::input_iterator_tag iterator_category; typedef T value_type; - struct reference : public RefBase { - reference(detail::dummy_constructor d) : RefBase(d) { } + struct reference { operator const value_type&() const { return static_object::get(); } }; typedef const T* pointer; @@ -425,7 +424,7 @@ namespace boost { self& operator=(const self&) { return *this; } bool operator==(const self&) const { return true; } bool operator!=(const self&) const { return true; } - const reference& operator*() const { return static_object::get(); } + reference operator*() const { return reference(); } self& operator++() { return *this; } self operator++(int) { return *this; } }; diff --git a/stl_concept_covering.cpp b/stl_concept_covering.cpp index 57485e1..5b05beb 100644 --- a/stl_concept_covering.cpp +++ b/stl_concept_covering.cpp @@ -141,9 +141,10 @@ main() f(dummy_cons); std::for_each(in, in, f); } + // gcc bug { typedef equality_comparable2_first_archetype<> Left; - input_iterator_archetype in; + input_iterator_archetype< Left > in; equality_comparable2_second_archetype<> value(dummy_cons); in = std::find(in, in, value); } @@ -164,16 +165,17 @@ main() pred(dummy_cons); fo = std::adjacent_find(fo, fo, pred); } + // gcc bug { typedef equal_op_first_archetype<> Left; - forward_iterator_archetype in; + input_iterator_archetype in; typedef equal_op_second_archetype<> Right; forward_iterator_archetype fo; in = std::find_first_of(in, in, fo, fo); } { typedef equal_op_first_archetype<> Left; - typedef input_iterator_archetype InIter; + typedef input_iterator_archetype InIter; InIter in; function_requires< InputIteratorConcept >(); equal_op_second_archetype<> value(dummy_cons); @@ -189,12 +191,13 @@ main() n = std::count_if(in, in, pred); ignore_unused_variable_warning(n); } + // gcc bug { typedef equal_op_first_archetype<> Left; - typedef input_iterator_archetype InIter1; + typedef input_iterator_archetype InIter1; InIter1 in1; typedef equal_op_second_archetype<> Right; - typedef input_iterator_archetype InIter2; + typedef input_iterator_archetype InIter2; InIter2 in2; std::pair p = std::mismatch(in1, in1, in2); ignore_unused_variable_warning(p); @@ -207,11 +210,12 @@ main() std::pair p = std::mismatch(in1, in1, in2, pred); ignore_unused_variable_warning(p); } + // gcc bug { typedef equality_comparable2_first_archetype<> Left; - input_iterator_archetype in1; + input_iterator_archetype in1; typedef equality_comparable2_second_archetype<> Right; - input_iterator_archetype in2; + input_iterator_archetype in2; bool b = std::equal(in1, in1, in2); ignore_unused_variable_warning(b); } @@ -352,7 +356,7 @@ main() typedef equal_op_first_archetype<> Tin; typedef null_archetype<> Tout; typedef equal_op_second_archetype< convertible_to_archetype > T; - input_iterator_archetype in; + input_iterator_archetype in; output_iterator_archetype out(dummy_cons); T value(dummy_cons); out = std::replace_copy(in, in, out, value, value); @@ -411,12 +415,13 @@ main() unary_predicate_archetype pred(dummy_cons); fi = std::remove_if(fi, fi, pred); } + // gcc bug { typedef null_archetype<> Tout; typedef equality_comparable2_first_archetype< convertible_to_archetype > Tin; typedef equality_comparable2_second_archetype<> T; - input_iterator_archetype in; + input_iterator_archetype in; output_iterator_archetype out(dummy_cons); T value(dummy_cons); out = std::remove_copy(in, in, out, value); @@ -443,9 +448,10 @@ main() binary_predicate_archetype pred(dummy_cons); fi = std::unique(fi, fi, pred); } + // gcc bug { typedef equality_comparable_archetype< sgi_assignable_archetype<> > T; - input_iterator_archetype in; + input_iterator_archetype in; output_iterator_archetype out(dummy_cons); out = std::unique_copy(in, in, out); }