forked from boostorg/concept_check
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]
This commit is contained in:
@@ -408,7 +408,7 @@ namespace boost {
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
// Iterator Archetype Classes
|
// Iterator Archetype Classes
|
||||||
|
|
||||||
template <class T, int I = 0>
|
template <class T, int I = 0, class RefBase = null_archetype<> >
|
||||||
class input_iterator_archetype
|
class input_iterator_archetype
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -416,7 +416,8 @@ namespace boost {
|
|||||||
public:
|
public:
|
||||||
typedef std::input_iterator_tag iterator_category;
|
typedef std::input_iterator_tag iterator_category;
|
||||||
typedef T value_type;
|
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<T>::get(); }
|
operator const value_type&() const { return static_object<T>::get(); }
|
||||||
};
|
};
|
||||||
typedef const T* pointer;
|
typedef const T* pointer;
|
||||||
@@ -424,7 +425,7 @@ namespace boost {
|
|||||||
self& operator=(const self&) { return *this; }
|
self& operator=(const self&) { return *this; }
|
||||||
bool operator==(const self&) const { return true; }
|
bool operator==(const self&) const { return true; }
|
||||||
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<reference>::get(); }
|
||||||
self& operator++() { return *this; }
|
self& operator++() { return *this; }
|
||||||
self operator++(int) { return *this; }
|
self operator++(int) { return *this; }
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user