|
Boost Users : |
From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2005-08-15 15:15:41
On 8/15/05, Thorsten Ottosen <nesotto_at_[hidden]> wrote:
>
> "Kevin Wheatley" <hxpro_at_[hidden]> wrote in message
> news:4300715B.ED49E94C_at_cinesite.co.uk...
> > I had some code that with 1.32 compiled fine when compiled with
> > warnings as errors, but now with 1.33 I get:
>
> > Compiled with gcc 3.2.3 under Linux,
> >
> > perhaps something like this is needed?
>
> > template< class Char >
> > inline Char* str_end( Char* s )
> > {
> > - return (Char*)str_end( s, s );
> > + return const_cast<Char*>(str_end( s, s ));
>
> what's the difference? A c-style cast is also a const-cast.
Probably the difference is in the compiler, since if it warns that a
const_cast is discarding a qualifier would be useless. But would be a
somewhat valuable warning in a c-style cast. Although in my g++(3.3.4)
it doesnt warn anything in a c-style cast...
>
> -Thorsten
>
-- Felipe Magno de Almeida Developer from synergy and Computer Science student from State University of Campinas(UNICAMP). Unicamp: http://www.ic.unicamp.br Synergy: http://www.synergy.com.br "There is no dark side of the moon really. Matter of fact it's all dark."
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net