It's not totally convenient, but what I'm currently using is a slightly
less elaborate struct:
structA
{intv;}
Since all I'm creating is an isolated type, the private stuff isn't
needed. If I wanted to get fancy I could start implementing
operations. Comparison is free, as st
On Tuesday, 2 June 2015 at 21:44:33 UTC, Ali Çehreli wrote:
On 06/02/2015 01:16 PM, "Per =?UTF-8?B?Tm9yZGzDtnci?=
" wrote:
Is there some elegant way of creating "isolated" types in D
similar to
the semantics of `subtype` in Ada.
Correction, this is not subtype but a *derived* type, as
ty
On 06/02/2015 01:16 PM, "Per =?UTF-8?B?Tm9yZGzDtnci?=
" wrote:
Is there some elegant way of creating "isolated" types in D similar to
the semantics of `subtype` in Ada.
Something like this
struct A
{
this(int value) { this._value = value; }
private int _value;
alias _value this;
Is there some elegant way of creating "isolated" types in D
similar to the semantics of `subtype` in Ada.
Something like this
struct A
{
this(int value) { this._value = value; }
private int _value;
alias _value this;
}
struct B
{
this(int value) { this._value = value; }
pri