Dicebot on leaving D: It is anarchy driven development in all its glory.

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Aug 28 20:33:46 UTC 2018


On Tue, Aug 28, 2018 at 06:44:37PM +0000, aliak via Digitalmars-d wrote:
> On Tuesday, 28 August 2018 at 17:53:36 UTC, H. S. Teoh wrote:
> > On Tue, Aug 28, 2018 at 10:20:06AM -0700, Manu via
> > > D has no way to express head-const, and it turns out it's a
> > > tremendously useful concept.
> > 
> > I can live without head-const... but what *really* makes const
> > painful for me is the lack of head-mutable. I.e., given a const
> > container (which implies const objects), there is no universal way
> > to obtain a mutable reference to said const objects, unless you
> > tread into UB territory by forcefully casting it away.  This makes
> > const so limited in applicability that, for the most part, I've
> > given up using const at all, in spite of having tried quite hard to
> > use it as much as possible for years.
> 
> Simen's opHeadMutable [0] was pretty good solution to this const range
> stuff, but for some reason (not specified by anyone in the thread) it
> didn't seem to catch on :/
> 
> [0] https://forum.dlang.org/post/zsaqtmvqmfkzhrmrmrju@forum.dlang.org
[...]

Probably because nobody pushed it hard enough to make it happen.


T

-- 
It only takes one twig to burn down a forest.


More information about the Digitalmars-d mailing list