Head Const

ixid via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 18 06:58:00 PST 2016


On Thursday, 18 February 2016 at 11:57:59 UTC, Jonathan M Davis 
wrote:
>The problem that folks frequently want to be able to solve that 
>they simply cannot solve >with D's const (and headconst wouldn't 
>help) is that they want to be able to pass an object >to a 
>function that takes it as const or return a const object from a 
>const member function >and have stuff like reference counting, 
>caching, mutexes, etc. work - stuff that has to be >part of the 
>object (at least in pure code) but which isn't part of its 
>logical state and >cannot be const.

Is it not possible to have two objects, the data and the 
information about the data? It seems like a mistake to try to 
treat metadata as the data. I just ask out of interest as I lack 
the experience to have a meaningful view, the category confusion 
between data and metadata seems like a path to excessive 
complexity.


More information about the Digitalmars-d mailing list