Old problem with performance
Michel Fortin
michel.fortin at michelf.com
Mon Feb 9 04:34:44 PST 2009
On 2009-02-09 07:00:56 -0500, Weed <resume755 at mail.ru> said:
>> No. By forbiding the cases that leads to slicing, like returning a
>> polymorphic object by value.
>
> Let's think, can there are other ways to solve problem?
>
> Here, for example my reasons:
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=81958
I'm
>
not sure I'm getting what you mean in that post.
It seems like you want the ability to copy classes, and thus pass them
by value, but only when there would be no type conversion.
I'm not getting where this can be useful though: by forcing your
classes to be of a specific type, with no derived types allowed, you're
losing polymorphism. The only advantage you have is that your type can
be derived from another so you can reuse some of its implementation.
There are other ways to acheive that in D however (mixins come to mind).
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d
mailing list