Template Base Classes, Refering to typeof(this)

BCS none at anon.com
Wed Nov 4 15:19:04 PST 2009


Hello Travis,

> Ellery Newcomer wrote:
> 
>> Travis Boucher wrote:
>> 
>>> Any hints on how to implement this so I can keep my original
>>> declaration? class VectorBase(size_t S, T)
>>> 
>> Make that bugger a struct or forget about opAssign.
>> 
> Why wouldn't opAssign work for a class?  (I don't have a problem with
> structs, they make more sense for a small (2-5) Vector class anyway.)
> 
> From what I understand, structs can't inherit from other structs. I
> could implement the specific classes using template mixins if needed.
> 

//given: 
Class c, d;

c=d; // this is *always* a reference copy.





More information about the Digitalmars-d mailing list