"Michael D. Pritchett" wrote:
> 
> From: Joaquín Cuenca Abela <[EMAIL PROTECTED]>
> Sent: Saturday, April 14, 2001 2:13 PM
> 
> > operator[] and operator[] const for UT_String
> >
> > Cheers,
> >
> > --
> > Joaquín Cuenca Abela
> > [EMAIL PROTECTED]
> >
> 
> Joaquin -
> 
> MSVC 5.0 is having difficultly with this:
> 
> char& UT_String::operator[](size_t iPos)
> {
>     UT_ASSERT(iPos <= size());
>      return pimpl->data()[iPos];
> }
> 
> saying something about return cannot  convert 'const char' to 'char &'.
> Substituting
> 
>      return (char) pimpl->data()[iPos];
> 
> allows it to compile and continue, but I am not sure if this is what you
> wanted.

not, at all.  (I'm not saying that this way it will not work, but a
const_cast<> is out of question.)
I added a 

        char_type*                      data()                    { return m_psz; }

method to UT_Stringbuf.  Can you please check that you have it?
If it's there, then MSVC 5.0 is broken here...

Cheers,

--
Joaquín Cuenca Abela
[EMAIL PROTECTED]

Reply via email to