Implementing tail-const in D

sclytrack sclytrack at fake.com
Sat Mar 10 21:17:01 UTC 2018


On Monday, 29 January 2018 at 13:07:05 UTC, Simen Kjærås wrote:
> On Thursday, 25 January 2018 at 21:33:10 UTC, Simen Kjærås 
> wrote:
>> On Thursday, 25 January 2018 at 19:54:55 UTC, H. S. Teoh wrote:
>>> In fact, if the standard implementation of opHeadMutable is 
>>> basically the same across all types (or most types), it could 
>>> even be provided as a mixin template in the library, then all 
>>> you have to do is to `mixin headMutable` or something along 
>>> those lines, and off you go.
>>
>> I believe this should be possible
>
> I wrote up a more formal description of what I'm suggesting:
>
> https://gist.github.com/Biotronic/c6eefeb9796309360a5e8696d91d924d
>
> --
>   Simen


@headUnqualified
struct HeadUnqualifiedType1
{
	HeadUnqualifiedType2 field;
}

tailQualifierHeadUnqualified(const) HeadUnqualifiedType1 a;

//Stupid opaque data types.




More information about the Digitalmars-d mailing list