Re: Eliminate new for class object creation?

2009-10-20 Thread Chris Nicholson-Sauls
Andrei Alexandrescu wrote: I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the expression creating a @struct@ object---Test(@\meta{args}@)@---and the

Re: Eliminate new for class object creation?

2009-10-20 Thread Kagamin
Andrei Alexandrescu Wrote: I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the expression creating a @struct@

Re: Eliminate new for class object creation?

2009-10-20 Thread Lionello Lunesu
On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one. There's extra cost involved, and the added keyword makes that clear. Also, somebody mentioned using 'new' to allocate structs on

Re: Eliminate new for class object creation?

2009-10-20 Thread Max Samukha
On Tue, 20 Oct 2009 18:12:39 +0800, Lionello Lunesu l...@lunesu.remove.com wrote: On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one. There's extra cost involved, and the added

Re: Eliminate new for class object creation?

2009-10-20 Thread Yigal Chripun
Chris Nicholson-Sauls Wrote: Andrei Alexandrescu wrote: I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the expression creating

Re: Eliminate new for class object creation?

2009-10-20 Thread Andrei Alexandrescu
Lionello Lunesu wrote: On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one. There's extra cost involved, and the added keyword makes that clear. That's actually one problem: a

Re: Eliminate new for class object creation?

2009-10-20 Thread Andrei Alexandrescu
Max Samukha wrote: On Tue, 20 Oct 2009 18:12:39 +0800, Lionello Lunesu l...@lunesu.remove.com wrote: On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one. There's extra cost involved,

Re: Eliminate new for class object creation?

2009-10-20 Thread Leandro Lucarella
Andrei Alexandrescu, el 19 de octubre a las 22:16 me escribiste: dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Leandro Lucarella wrote: Jason House, el 19 de octubre a las 22:20 me escribiste: Bill Baxter Wrote: On Mon, Oct 19, 2009 at 4:00 PM,

Re: Eliminate new for class object creation?

2009-10-20 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 19 de octubre a las 22:16 me escribiste: dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Leandro Lucarella wrote: Jason House, el 19 de octubre a las 22:20 me escribiste: Bill Baxter Wrote: On Mon,

Re: Eliminate new for class object creation?

2009-10-20 Thread Leandro Lucarella
Andrei Alexandrescu, el 20 de octubre a las 08:42 me escribiste: Why not Scoped!T ? I think the purpose for this that the lifetime of the object is bounded to the scope, right? I think is hard to figure that out from InSitu!T than Scoped!T. /useless discussion It's not a useless

Re: Eliminate new for class object creation?

2009-10-20 Thread Rainer Deyke
Andrei Alexandrescu wrote: Lionello Lunesu wrote: Also, somebody mentioned using 'new' to allocate structs on the heap; I've never actually done that, but it sounds like using 'new' would be the perfect way to do just that. Yah, I guess I'll drop it. Consistency with structs demands that

Re: Eliminate new for class object creation?

2009-10-20 Thread Chad J
Andrei Alexandrescu wrote: Leandro Lucarella wrote: Andrei Alexandrescu, el 19 de octubre a las 22:16 me escribiste: No problem. You will be able to use InSitu!T. It is much better to confine unsafe features to libraries instead of putting them in the language. { auto foo =

Re: Eliminate new for class object creation?

2009-10-20 Thread Pelle Månsson
Andrei Alexandrescu wrote: Max Samukha wrote: On Tue, 20 Oct 2009 18:12:39 +0800, Lionello Lunesu l...@lunesu.remove.com wrote: On 20-10-2009 6:38, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? I don't agree with this one.

Eliminate new for class object creation?

2009-10-19 Thread Andrei Alexandrescu
I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the expression creating a @struct@ object---Test(@\meta{args}@)@---and the expression creating a @class@

Re: Eliminate new for class object creation?

2009-10-19 Thread Adam D. Ruppe
On Mon, Oct 19, 2009 at 05:38:13PM -0500, Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? Didn't we go over this a few weeks ago? I think my preference would be a bunch of templates in phobos that take new's job, and can also do

Re: Eliminate new for class object creation?

2009-10-19 Thread Denis Koroskin
On Tue, 20 Oct 2009 02:38:13 +0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the

Re: Eliminate new for class object creation?

2009-10-19 Thread Andrei Alexandrescu
Denis Koroskin wrote: On Tue, 20 Oct 2009 02:38:13 +0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic

Re: Eliminate new for class object creation?

2009-10-19 Thread Yigal Chripun
On 20/10/2009 00:38, Andrei Alexandrescu wrote: I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the expression creating a @struct@

Re: Eliminate new for class object creation?

2009-10-19 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this: The syntactic difference between the expression creating a

Re: Eliminate new for class object creation?

2009-10-19 Thread Rainer Deyke
Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? *applause* 'X(x)' and 'new X(x)' have distinct meanings in C++. In Java/C#/D, the 'new' is just line noise. -- Rainer Deyke - rain...@eldwood.com

Re: Eliminate new for class object creation?

2009-10-19 Thread Bill Baxter
On Mon, Oct 19, 2009 at 4:00 PM, Rainer Deyke rain...@eldwood.com wrote: Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? *applause* 'X(x)' and 'new X(x)' have distinct meanings in C++.  In Java/C#/D, the 'new' is just line

Re: Eliminate new for class object creation?

2009-10-19 Thread Rainer Deyke
Bill Baxter wrote: On Mon, Oct 19, 2009 at 4:00 PM, Rainer Deyke rain...@eldwood.com wrote: 'X(x)' and 'new X(x)' have distinct meanings in C++. In Java/C#/D, the 'new' is just line noise. Well, I think new Foo is how you create a struct on the heap in D. So it's not exactly line noise. I

Re: Eliminate new for class object creation?

2009-10-19 Thread Jason House
Bill Baxter Wrote: On Mon, Oct 19, 2009 at 4:00 PM, Rainer Deyke rain...@eldwood.com wrote: Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? *applause* 'X(x)' and 'new X(x)' have distinct meanings in C++.  In

Re: Eliminate new for class object creation?

2009-10-19 Thread Leandro Lucarella
Jason House, el 19 de octubre a las 22:20 me escribiste: Bill Baxter Wrote: On Mon, Oct 19, 2009 at 4:00 PM, Rainer Deyke rain...@eldwood.com wrote: Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think? *applause*

Re: Eliminate new for class object creation?

2009-10-19 Thread Robert Jacques
On Mon, 19 Oct 2009 18:45:01 -0400, dsimcha dsim...@yahoo.com wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct object. I wrote this:

Re: Eliminate new for class object creation?

2009-10-19 Thread Brad Roberts
Robert Jacques wrote: On Mon, 19 Oct 2009 18:45:01 -0400, dsimcha dsim...@yahoo.com wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article I'm having a hard time justifying that you use new X(args) to create a class object, and X(args) to create a struct

Re: Eliminate new for class object creation?

2009-10-19 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Jason House, el 19 de octubre a las 22:20 me escribiste: Bill Baxter Wrote: On Mon, Oct 19, 2009 at 4:00 PM, Rainer Deyke rain...@eldwood.com wrote: Andrei Alexandrescu wrote: I hereby suggest we get rid of new for class object creation. What do you guys think?

Re: Eliminate new for class object creation?

2009-10-19 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Leandro Lucarella wrote: Jason House, el 19 de octubre a las 22:20 me escribiste: Bill Baxter Wrote: On Mon, Oct 19, 2009 at 4:00 PM, Rainer Deyke rain...@eldwood.com wrote: Andrei Alexandrescu wrote: I hereby

Re: Eliminate new for class object creation?

2009-10-19 Thread Robert Jacques
On Mon, 19 Oct 2009 22:53:23 -0400, Brad Roberts bra...@puremagic.com wrote: Robert Jacques wrote: On Mon, 19 Oct 2009 18:45:01 -0400, dsimcha dsim...@yahoo.com wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article I'm having a hard time justifying that you

Re: Eliminate new for class object creation?

2009-10-19 Thread Andrei Alexandrescu
dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Leandro Lucarella wrote: Jason House, el 19 de octubre a las 22:20 me escribiste: Bill Baxter Wrote: On Mon, Oct 19, 2009 at 4:00 PM, Rainer Deyke rain...@eldwood.com wrote: Andrei Alexandrescu