[phobos] Fwd: Re: Ruling out arbitrary cost copy construction?

Michel Fortin michel.fortin at michelf.com
Mon Nov 1 08:59:33 PDT 2010


Le 2010-11-01 à 0:21, Andrei Alexandrescu a écrit :

> Alright, then how do we solve refcounting of constant objects (see Michel Fortin's question)? My solution involves casting away const and keeping immutability information at runtime. Is that acceptable?

I don't see a big problem in bypassing const. But const objects might be immutable, and immutable objects are implicitly shared. So for immutable objects you'll need to use atomic increment/decrement on the reference counter; is this why you want to keep track of immutability at runtime?

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





More information about the phobos mailing list