RE: [Re: [AD] New WIP]

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> > The const keyword isn't just the simple statement "compiler, I will not
> > change this object's data" - it is the statement "user, I will not
> > change your object's appearance or behaviour".
> 
> I disagree -- if it's a message for the user, you should write
> /*const*/.  The keyword `const' has meaning to the compiler, and
> using it properly lets the compiler perform better
> optimisations.  But if you overuse it, the generated code may be
> wrong.
And impossible to read.
I've always thought I'd not bother to use const until compilers would
begin to make decent optimizations for that. Your sentence opens the
possibility that they now do: does gcc optimize const now ?

-- 
Lyrian 



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/