The Status of Const

Michel Fortin michel.fortin at michelf.com
Fri Aug 13 19:40:51 PDT 2010


On 2010-08-13 20:45:13 -0400, dsimcha <dsimcha at yahoo.com> said:

> http://dsource.org/projects/phobos/changeset/1849
> 
> I've added some trivial convenience functions to Phobos that should have been
> there a long time ago and should go a long way towards making Rebindable more
> usable.  The other thing we need is bug fixes in alias this/opDot, 
> which we need
> eventually anyhow.  Now, instead of doing something like this ugly, verbose,
> specify-things-twice code:
> 
> auto foo = Rebindable!(LongTypeName)(new LongTypeName);  // Shoot me.
> 
> You can do:
> 
> auto foo = rebindable(new LongTypeName);  // Sanity restored.

Now the question for genericity's sake is: should 
Unqual!(const(Object)) give you the type Rebindable!(const(Object))?

Unfortunately, you probably can't get this one right without some help 
from the compiler: immutable(Rebindable!(const(Object)))?

And what will Unqual do with this: 
Unqual!(immutable(Rebindable!(const(Object)))?

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list