bearophile wrote:
(I don't know why templated methods can't be virtual)
First of all, they can. But it's a shitload of extra work, and requires
that compilation be mixed up with linking.
Whenever a templated method is used from any subclass, it has to be
generated for the base class, and an
bearophile wrote:
> (I don't know why templated methods can't be virtual), so I leave the
bug report to someone else that's able to write something meaningful in
the bug report :-)
I created a bug report just about the compiler error message:
http://d.puremagic.com/issues/show_bug.cgi?id=53
I know this is just playing dangerous, still tempting to use for things like
plugins ,"member interfaces" or even struct interfaces.
It is easy to do without unions because delegates have ptr and funcptr pointers
with just a swap of pointers.
Are .ptr and .funcptr really needed to be writeable?
"
Ellery Newcomer wrote:
why does SList.insertFront have a complexity of O(log(n)) ?
Good question! It certainly is not the code's fault, as that's O(1) for
single elements and O(m) for ranges. File it to Bugzilly, I guess.
--
Simen
why does SList.insertFront have a complexity of O(log(n)) ?
Andrej Mitrovic:
> Agreed. Can you file a bug report?
Sorry, but I don't understand the topic enough yet (I don't know why templated
methods can't be virtual), so I leave the bug report to someone else that's
able to write something meaningful in the bug report :-)
Bye,
bearophile
On 12/28/10, bearophile wrote:
> But the error messages given by DMD 2.051 aren't easy to understand for me:
>
> test.d(10): Error: variable test.Bar.draw!(int).draw.this override cannot be
> applied to variable
> test.d(10): Error: variable test.Bar.draw!(int).draw.t override cannot be
> applied
Ali Ãehreli:
> > But uncomment the override and it fails.
>
> That's because "Templates cannot be used to add [...] virtual functions
> to classes"
But the error messages given by DMD 2.051 aren't easy to understand for me:
test.d(10): Error: variable test.Bar.draw!(int).draw.this override c
Thanks, Ali! :)
Andrej Mitrovic wrote:
> I think this is relevant:
> http://www.digitalmars.com/d/2.0/template.html : "Limitations":
>
> Templates cannot be used to add non-static members or virtual
> functions to classes.
> Templates cannot add functions to interfaces.
>
> But I'm a little confused as to how it
28.12.2010 20:42, David Nadlinger пишет:
On 12/28/10 2:09 AM, Stanislav Blinov wrote:
I don't think I got what David meant with it either. Assigning instances
of the same type is perfectly valid as long as you do not define some
very peculiar opAssign.
The point here is that person1 and person
On 12/28/10 2:09 AM, Stanislav Blinov wrote:
I don't think I got what David meant with it either. Assigning instances
of the same type is perfectly valid as long as you do not define some
very peculiar opAssign.
The point here is that person1 and person2 are not instances of the same
type, try
== Quote from Stanislav Blinov (stanislav.bli...@gmail.com)'s article
> On 12/27/2010 06:41 PM, Hamad Mohammad wrote:
> >> If you tried to assign person2 to person1 or vice versa
> >
> > how?
> >
> I don't think I got what David meant with it either. Assigning instances
> of the same type is perfec
13 matches
Mail list logo