const debacle

Bill Baxter dnewsgroup at billbaxter.com
Mon Mar 24 08:48:55 PDT 2008


Janice Caron wrote:
> On 24/03/2008, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
>> Steven Schveighoffer wrote:
>>  > I also want to be able to specify that the compiler should
>>  > complain if the function modifies the mutable input.
>>
>> I think that right there is basically the *only* think I really want out
>>  of a const system.  And even for that "best effort" is good enough for
>>  me.
> 
> No less than three working solutions have been mentioned on this
> thread: a template solution, suggested by me; a solution using an
> explicit cast suggested by Daniel919; and the notion of returning
> indeces suggested by me. How many more working solutions do we need?
> This is a solved problem.

It's not the fact that it can be done or cannot be done so much as it 
requiring 3 people and a dozen posts to piece together first what the 
actual objective was and second how to do it.  Just give me a simple way 
to avoid shooting myself in the foot in obvious ways and I think I will 
be satisfied, even if the result does not offer a 100% guarantee.

--bb




More information about the Digitalmars-d mailing list