Why can't we derive struct's?
rikki cattermole
rikki at cattermole.co.nz
Fri Dec 21 04:54:40 UTC 2018
On 21/12/2018 5:09 PM, Walter Bright wrote:
> On 12/20/2018 7:21 PM, Timon Gehr wrote:
>> But it's a solved problem. Just make `alias this` exactly like `import`.
>
> Imports don't have adjuster thunks, implicit cast issues, slicing, or
> empty base optimizations. Import lookup in a class is different because
> of the two-phase nature of it (people complained bitterly about the
> earlier single phase lookup).
>
> Import lookup doesn't have to conform to the relevant undocumented C++
> ABI, either. (It was about a year of bug reports until I was finally
> able to match Microsoft C++'s MFC behavior for MI struct layout.)
>
> class C : B {
> B b;
> alias b this;
> }
>
> Now what? (This is not specified in the dlang spec.)
Type Declaration -> alias this [0 .. $]
At declaration site or the alias this, if it is not free-of-issues, error.
Say didn't we have a DIP that was accepted for multiple alias this?
More information about the Digitalmars-d
mailing list