Re: c++ operator << support for debug()()

From: Robert Collins <robertc@dont-contact.us>
Date: 12 Jul 2003 21:26:14 +1000

On Sat, 2003-07-12 at 20:55, Serassio Guido wrote:

> Thanks, but now I get different errors:
>
> c:\work\nt-3.0\include\array.h(60) : error C2063: '*' : not a function
> c:\work\nt-3.0\include\array.h(75) : see reference to class
> template instantiation 'VectorIteratorBase<C>' being compiled
> c:\work\nt-3.0\include\array.h(60) : error C2040: '*' : 'generic-type-257
> &(void) const' differs in levels of indirection from 'int'
> c:\work\nt-3.0\include\array.h(75) : see reference to class
> template instantiation 'VectorIteratorBase<C>' being compiled
> c:\work\nt-3.0\include\array.h(60) : fatal error C1903: unable to recover
> from previous error(s); stopping compilation
> c:\work\nt-3.0\include\array.h(75) : see reference to class
> template instantiation 'VectorIteratorBase<C>' being compiled
>
> And this is the changed source from line 59
>
> typename C::value_type & VectorIteratorBase<C>::operator *() const
> { <== This is my line 60
> return theVector->items[pos];
> }
> typename C::value_type * VectorIteratorBase<C>::operator -> () const
> {
> return &theVector->items[pos];
> }
>
> // typename C::value_type & operator *() const;
> // typename C::value_type * operator -> () const;
> ssize_t operator - (VectorIteratorBase const &rhs) const;
> bool incrementable() const;
> private:
> size_t pos;
> C * theVector;
> }; <== This is my line 75

ah, my fault.
Try this:
     typename C::value_type & operator *() const
     {
         return theVector->items[pos];
     }
     typename C::value_type * operator -> () const
     {
         return &theVector->items[pos];
     }

// typename C::value_type & operator *() const;
// typename C::value_type * operator -> () const;
     ssize_t operator - (VectorIteratorBase const &rhs) const;
     bool incrementable() const;
   private:
     size_t pos;
     C * theVector;
};

> I agree totally, but I remember too the VHS / Video 2000 / Betamax fight
> for the Video Tape standardization:
> the winner was VHS, the worse technology ..... (sigh !)

Lol, yes. The key difference IMO is that the worse technology was
cheaper, whereas ... :}.

Rob

-- 
GPG key available at: <http://members.aardvark.net.au/lifeless/keys.txt>.

Received on Sat Jul 12 2003 - 05:26:25 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:20:16 MST