const debacle

Bill Baxter dnewsgroup at billbaxter.com
Sat Mar 22 13:18:41 PDT 2008


Steven Schveighoffer wrote:
> "Janice Caron" wrote

> I have been thinking about this a lot, and I think actually in the grand 
> scheme of things, this is not a blocker, as even though the compiler does 
> not guarantee constness for the non-const version, one can document that a 
> function is const (and even test this by compiling a const version in a 
> unittest).  However, it is a hole in the const scheme, which should probably 
> be fixed at some point.

So the solution to your problem is to use "documentation" const?  The 
good thing about that is that it works for D1.0 too!  :-)

--bb



More information about the Digitalmars-d mailing list