From ce3fb4f6405202ede427815672898c97b095f3ad Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Thu, 28 Jul 2005 15:39:59 +0000 Subject: [PATCH] change to input_iterator_archetype to add a type parameter for the base class of the reference type. Needed this, for example, to get the concept covering test for std::count right. [SVN r30287] --- include/boost/concept_archetype.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/boost/concept_archetype.hpp b/include/boost/concept_archetype.hpp index f21c817..e020dd7 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,7 +416,8 @@ namespace boost { public: typedef std::input_iterator_tag iterator_category; typedef T value_type; - struct reference { + struct reference : public RefBase { + reference(detail::dummy_constructor d) : RefBase(d) { } operator const value_type&() const { return static_object::get(); } }; typedef const T* pointer; @@ -424,7 +425,7 @@ namespace boost { self& operator=(const self&) { return *this; } bool operator==(const self&) const { return true; } bool operator!=(const self&) const { return true; } - reference operator*() const { return reference(); } + const reference& operator*() const { return static_object::get(); } self& operator++() { return *this; } self operator++(int) { return *this; } };