This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-970929: bug in overloading resolution
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Re: egcs-970929: bug in overloading resolution
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Thu, 2 Oct 1997 10:27:28 +0200 (MET DST)
- Xref: yorick.cygnus.com mail.work:3303
On 1 Oct 1997, Jason Merrill wrote:
> I'll need a complete testcase if I'm going to work on this bug.
>
> Jason
Here it is. My command line is 'g++ -Wall -g test.cc'.
Thank you!
Best regards,
Dirk Herrmann
#include <vector>
#include <iterator>
template<class Container>
class range_iterator
{
public:
range_iterator() {}
explicit range_iterator(Container& c)
: pos(c.begin()), end(c.end()) {}
~range_iterator() {}
range_iterator<Container>& operator ++()
{ if (*this) ++pos; return *this; }
operator bool() const
{ return pos != end; }
operator typename Container::iterator()
{ return pos; }
protected:
typename Container::iterator pos;
typename Container::iterator end;
};
int main()
{
vector<int> v(10);
int count = 0;
for ( range_iterator< vector<int> > i(v);
i;
++i)
{
cout << count++ << '\n';
};
return 0;
}