Should operator overload methods be virtual?

2009-11-27 Thread Walter Bright
Making them not virtual would also make them not overridable, they'd all be implicitly final. Is there any compelling use case for virtual operator overloads? Keep in mind that any non-virtual function can still be a wrapper for another virtual method, so it is still possible (with a bit of ex

Re: Should operator overload methods be virtual?

2009-11-27 Thread Denis Koroskin
On Sat, 28 Nov 2009 02:32:21 +0300, Walter Bright wrote: Making them not virtual would also make them not overridable, they'd all be implicitly final. Is there any compelling use case for virtual operator overloads? Keep in mind that any non-virtual function can still be a wrapper for an

Re: Should operator overload methods be virtual?

2009-11-27 Thread dsimcha
== Quote from Walter Bright (newshou...@digitalmars.com)'s article > Making them not virtual would also make them not overridable, they'd all > be implicitly final. > Is there any compelling use case for virtual operator overloads? Keep in > mind that any non-virtual function can still be a wrapper

Re: Should operator overload methods be virtual?

2009-11-27 Thread retard
Fri, 27 Nov 2009 15:32:21 -0800, Walter Bright wrote: > Making them not virtual would also make them not overridable, they'd all > be implicitly final. > > Is there any compelling use case for virtual operator overloads? Keep in > mind that any non-virtual function can still be a wrapper for anot

Re: Should operator overload methods be virtual?

2009-11-27 Thread dsimcha
== Quote from retard (r...@tard.com.invalid)'s article > Fri, 27 Nov 2009 15:32:21 -0800, Walter Bright wrote: > > Making them not virtual would also make them not overridable, they'd all > > be implicitly final. > > > > Is there any compelling use case for virtual operator overloads? Keep in > > m

Re: Should operator overload methods be virtual?

2009-11-27 Thread Robert Jacques
On Fri, 27 Nov 2009 22:58:00 -0500, retard wrote: Fri, 27 Nov 2009 15:32:21 -0800, Walter Bright wrote: Making them not virtual would also make them not overridable, they'd all be implicitly final. Is there any compelling use case for virtual operator overloads? Keep in mind that any non-vir

Re: Should operator overload methods be virtual?

2009-11-28 Thread bearophile
dsimcha: > but it would introduce an > inconsistency into the language relative to "regular" methods. Right, it's an exception to a rule of the language, so it increases the language complexity. Bye, bearophile

Re: Should operator overload methods be virtual?

2009-11-28 Thread retard
Sat, 28 Nov 2009 08:16:33 -0500, bearophile wrote: > dsimcha: >> but it would introduce an >> inconsistency into the language relative to "regular" methods. > > Right, it's an exception to a rule of the language, so it increases the > language complexity. I guess the systems programming language

Re: Should operator overload methods be virtual?

2009-11-28 Thread dsimcha
== Quote from retard (r...@tard.com.invalid)'s article > Sat, 28 Nov 2009 08:16:33 -0500, bearophile wrote: > > dsimcha: > >> but it would introduce an > >> inconsistency into the language relative to "regular" methods. > > > > Right, it's an exception to a rule of the language, so it increases the

Re: Should operator overload methods be virtual?

2009-11-28 Thread Walter Bright
Denis Koroskin wrote: I thought operator overloading was going to be implemented via templates. As such, they are non-virtual by default, which is okay, in my opinion. Yes, that's the rationale. I'm looking for a hole in it.

Re: Should operator overload methods be virtual?

2009-11-28 Thread Walter Bright
retard wrote: Is this again one of those features that is supposed to hide the fact that dmd & optlink toolchain sucks? At least gcc can optimize the calls in most cases where the operator is defined to be virtual, but is used in non-polymorphic manner. The gnu linker (ld) does not do any opt

Re: Should operator overload methods be virtual?

2009-11-29 Thread Leandro Lucarella
Walter Bright, el 28 de noviembre a las 13:31 me escribiste: > retard wrote: > >Is this again one of those features that is supposed to hide the > >fact that dmd & optlink toolchain sucks? At least gcc can optimize > >the calls in most cases where the operator is defined to be > >virtual, but is us

Re: Should operator overload methods be virtual?

2009-12-01 Thread Steven Schveighoffer
On Fri, 27 Nov 2009 18:32:21 -0500, Walter Bright wrote: Making them not virtual would also make them not overridable, they'd all be implicitly final. Is there any compelling use case for virtual operator overloads? Keep in mind that any non-virtual function can still be a wrapper for an

Re: Should operator overload methods be virtual?

2009-12-01 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Fri, 27 Nov 2009 18:32:21 -0500, Walter Bright wrote: Making them not virtual would also make them not overridable, they'd all be implicitly final. Is there any compelling use case for virtual operator overloads? Keep in mind that any non-virtual function can

Re: Should operator overload methods be virtual?

2009-12-01 Thread Walter Bright
Leandro Lucarella wrote: Walter Bright, el 28 de noviembre a las 13:31 me escribiste: retard wrote: Is this again one of those features that is supposed to hide the fact that dmd & optlink toolchain sucks? At least gcc can optimize the calls in most cases where the operator is defined to be vir

Re: Should operator overload methods be virtual?

2009-12-01 Thread Leandro Lucarella
Walter Bright, el 1 de diciembre a las 11:17 me escribiste: > Leandro Lucarella wrote: > >Walter Bright, el 28 de noviembre a las 13:31 me escribiste: > >>retard wrote: > >>>Is this again one of those features that is supposed to hide the > >>>fact that dmd & optlink toolchain sucks? At least gcc

Re: Should operator overload methods be virtual?

2009-12-01 Thread Steven Schveighoffer
On Tue, 01 Dec 2009 13:53:37 -0500, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: On Fri, 27 Nov 2009 18:32:21 -0500, Walter Bright wrote: Making them not virtual would also make them not overridable, they'd all be implicitly final. Is there any compelling use case for virtu

Re: Should operator overload methods be virtual?

2009-12-01 Thread dsimcha
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article > If the compiler could somehow > optimize out all instances of the template function to reduce bloat, I > think that would make it a little less annoying. What is the sudden obsession with code bloat here lately? Check out this S

Re: Should operator overload methods be virtual?

2009-12-01 Thread Steven Schveighoffer
On Tue, 01 Dec 2009 16:28:14 -0500, dsimcha wrote: == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article If the compiler could somehow optimize out all instances of the template function to reduce bloat, I think that would make it a little less annoying. What is the sudden obses

Re: Should operator overload methods be virtual?

2009-12-01 Thread dsimcha
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article > On Tue, 01 Dec 2009 16:28:14 -0500, dsimcha wrote: > > == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article > >> If the compiler could somehow > >> optimize out all instances of the template function to reduce bloat

Re: Should operator overload methods be virtual?

2009-12-01 Thread Don
Steven Schveighoffer wrote: On Tue, 01 Dec 2009 13:53:37 -0500, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: On Fri, 27 Nov 2009 18:32:21 -0500, Walter Bright wrote: Making them not virtual would also make them not overridable, they'd all be implicitly final. Is there any com

Re: Should operator overload methods be virtual?

2009-12-01 Thread retard
Tue, 01 Dec 2009 16:48:34 -0500, Steven Schveighoffer wrote: > On Tue, 01 Dec 2009 16:28:14 -0500, dsimcha wrote: > >> == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article >>> If the compiler could somehow >>> optimize out all instances of the template function to reduce bloat, I >

Re: Should operator overload methods be virtual?

2009-12-02 Thread Steven Schveighoffer
On Wed, 02 Dec 2009 01:36:54 -0500, retard wrote: If it leaks 200 MB per day, people can already run it for a month on a typical home PC before the machine runs out of physical memory (assuming 8GB physical RAM like most of my friends have these days on their $500-600 systems). Notice I said

Re: Should operator overload methods be virtual?

2009-12-02 Thread retard
Wed, 02 Dec 2009 13:15:33 -0500, Steven Schveighoffer wrote: > I don't know what typical users you know, but the typical users I know > do not reboot their computer unless it requires it. Most of the people > I know have installed so much bloatware on their system that it takes 20 > minutes to bo