On Sunday, 5 November 2017 at 07:07:43 UTC, Aurelien Fredouelle
wrote:
struct S { }
class A
{
S s;
alias s this;
}
class B : A
{
}
void main()
{
A asA = new B;
B asB = cast(B)asA;
}
I would expect the last line to successfully cast the B
instance I created back into type B, however
The following code does not compile:
struct S { }
class A
{
S s;
alias s this;
}
class B : A
{
}
void main()
{
A asA = new B;
B asB = cast(B)asA;
}
I would expect the last line to successfully cast the B instance
I created back into type B, however this seems to be preempted by
the
On Wed, 23 Feb 2011 10:34:04 -0500, spir denis.s...@gmail.com wrote:
Hello,
I have read several times that alias this is a way to implement
inheritance for structs.
I am simply unable to imagine how to use this feature that way. Has
anyone an example?
It allows *some* simulation of