Re: Destructors, const structs, and opEquals

2010-12-21 Thread Bruno Medeiros
On 10/12/2010 20:58, Andrei Alexandrescu wrote: On 12/10/10 12:46 PM, Steven Schveighoffer wrote: On Mon, 06 Dec 2010 08:34:20 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 05 Dec 2010 09:18:13 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Sorry, indeed I

Re: Destructors, const structs, and opEquals

2010-12-21 Thread Bruno Medeiros
On 10/12/2010 21:17, Andrei Alexandrescu wrote: We all need to think about this a bit more because it's related to another issue that I'm still losing sleep over: should we promote cheap copy construction throughout D or not? I was reminded of another comment that could be said in favor of

Re: Destructors, const structs, and opEquals

2010-12-14 Thread Don
Brad Roberts wrote: On 12/13/2010 2:54 PM, Don wrote: I can't really escape the feeling that 'const' guarantees too little. It makes guarantees to the caller, but tells the callee *nothing*. As far as I'm concerned, that's exactly what I want const for. The caller can rely on the object not

Re: Destructors, const structs, and opEquals

2010-12-14 Thread Don
Jesse Phillips wrote: Don Wrote: I can't really escape the feeling that 'const' guarantees too little. It makes guarantees to the caller, but tells the callee *nothing*. But it tells the callee exactly what it does, (assuming you unintuitive associate that const objects can be modified).

Re: Destructors, const structs, and opEquals

2010-12-14 Thread Steven Schveighoffer
On Mon, 13 Dec 2010 17:54:57 -0500, Don nos...@nospam.com wrote: I can't really escape the feeling that 'const' guarantees too little. It makes guarantees to the caller, but tells the callee *nothing*. This is the basis of my argument that adding logical const would not compromise the

Re: Destructors, const structs, and opEquals

2010-12-13 Thread Don
Andrei Alexandrescu wrote: On 12/10/10 4:10 PM, foobar wrote: Don Wrote: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of 'auto' is an abomination. I agree with don. IMHO, this is

Re: Destructors, const structs, and opEquals

2010-12-13 Thread Andrei Alexandrescu
On 12/13/10 9:28 AM, Don wrote: Andrei Alexandrescu wrote: On 12/10/10 4:10 PM, foobar wrote: Don Wrote: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of 'auto' is an abomination. I

Re: Destructors, const structs, and opEquals

2010-12-13 Thread Don
Andrei Alexandrescu wrote: On 12/13/10 9:28 AM, Don wrote: Andrei Alexandrescu wrote: On 12/10/10 4:10 PM, foobar wrote: Don Wrote: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of

Re: Destructors, const structs, and opEquals

2010-12-13 Thread Michel Fortin
On 2010-12-13 17:54:57 -0500, Don nos...@nospam.com said: BTW the really big problem I have with 'auto ref' is that it isn't 'auto', and it isn't 'ref'. I wouldn't have the same objection to something like 'autoref'. I don't like auto ref as a syntax either, but I also dislike the general

Re: Destructors, const structs, and opEquals

2010-12-13 Thread Brad Roberts
On 12/13/2010 2:54 PM, Don wrote: I can't really escape the feeling that 'const' guarantees too little. It makes guarantees to the caller, but tells the callee *nothing*. As far as I'm concerned, that's exactly what I want const for. The caller can rely on the object not being modified.

For whom is (was: D2? Re: Destructors, const structs, and opEquals)

2010-12-11 Thread spir
On Fri, 10 Dec 2010 21:25:49 -0500 Michel Fortin michel.for...@michelf.com wrote: On 2010-12-10 17:12:16 -0500, Don nos...@nospam.com said: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget)

Re: Destructors, const structs, and opEquals

2010-12-11 Thread spir
On Fri, 10 Dec 2010 18:28:08 -0800 Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: It's sort of ironic. Tu viens d'implementing yet another type constructor yourself! The need for yet another one signifie sûrement (probably means) their semantics (in the human sense) are wrongly

Re: Destructors, const structs, and opEquals

2010-12-11 Thread Don
Michel Fortin wrote: On 2010-12-10 17:12:16 -0500, Don nos...@nospam.com said: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of 'auto' is an abomination. One problem I'm starting to

Re: Destructors, const structs, and opEquals

2010-12-11 Thread Michel Fortin
On 2010-12-10 19:32:30 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org said: On 12/10/10 4:10 PM, foobar wrote: Don Wrote: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of

Re: Destructors, const structs, and opEquals

2010-12-11 Thread Andrei Alexandrescu
On 12/11/10 2:49 CST, spir wrote: On Fri, 10 Dec 2010 18:28:08 -0800 Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: It's sort of ironic. Tu viens d'implementing yet another type constructor yourself! The need for yet another one signifie sûrement (probably means) their semantics

Re: Destructors, const structs, and opEquals

2010-12-11 Thread spir
On Sat, 11 Dec 2010 09:06:33 -0500 Michel Fortin michel.for...@michelf.com wrote: On 2010-12-10 19:32:30 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org said: On 12/10/10 4:10 PM, foobar wrote: Don Wrote: Steven Schveighoffer wrote: To summarize for those looking for the

Re: Destructors, const structs, and opEquals

2010-12-11 Thread Michel Fortin
On 2010-12-11 11:48:36 -0500, spir denis.s...@gmail.com said: If parameters are 'in' or 'const' by default, then whether they are passed by value or by ref has no consequence, I guess. The compiler can then safel y choose the most efficent more --what it can do as it knows sizeof-- gross ly

Re: Destructors, const structs, and opEquals

2010-12-11 Thread so
If parameters are 'in' or 'const' by default, then whether they are passed by value or by ref has no consequence, I guess. The compiler can then safely choose the most efficent more --what it can do as it knows sizeof-- grossly structs by ref, the rest by value. Is this reasoning correct?

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Steven Schveighoffer
On Mon, 06 Dec 2010 08:34:20 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 05 Dec 2010 09:18:13 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/5/10 12:04 AM, Steven Schveighoffer wrote: I'm totally confused. I thought the point of auto ref was to

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Andrei Alexandrescu
On 12/10/10 12:46 PM, Steven Schveighoffer wrote: On Mon, 06 Dec 2010 08:34:20 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 05 Dec 2010 09:18:13 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/5/10 12:04 AM, Steven Schveighoffer wrote: I'm totally

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Steven Schveighoffer
On Fri, 10 Dec 2010 15:58:17 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/10/10 12:46 PM, Steven Schveighoffer wrote: On Mon, 06 Dec 2010 08:34:20 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 05 Dec 2010 09:18:13 -0500, Andrei Alexandrescu

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Andrei Alexandrescu
On 12/10/10 1:10 PM, Steven Schveighoffer wrote: On Fri, 10 Dec 2010 15:58:17 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/10/10 12:46 PM, Steven Schveighoffer wrote: On Mon, 06 Dec 2010 08:34:20 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 05 Dec

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Don
Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of 'auto' is an abomination.

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Max Samukha
On 12/10/2010 10:58 PM, Andrei Alexandrescu wrote: On 12/10/10 12:46 PM, Steven Schveighoffer wrote: On Mon, 06 Dec 2010 08:34:20 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 05 Dec 2010 09:18:13 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/5/10

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Andrej Mitrovic
Thanks a lot for taking time to explain! Anybody interested see the rationale explained in detail at http://thbecker.net/articles/rvalue_references/section_07.html or http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/ Thanks, I had trouble understanding what this whole rvalue

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Andrej Mitrovic
On 12/11/10, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Thanks a lot for taking time to explain! Anybody interested see the rationale explained in detail at http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/ Thanks, I had trouble understanding what this whole rvalue deal

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Andrej Mitrovic
On 12/11/10, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On 12/11/10, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Thanks a lot for taking time to explain! Anybody interested see the rationale explained in detail at http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Andrej Mitrovic
On 12/11/10, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On 12/11/10, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Thanks a lot for taking time to explain! Anybody interested see the rationale explained in detail at http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/

Re: Destructors, const structs, and opEquals

2010-12-10 Thread foobar
Don Wrote: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of 'auto' is an abomination. I agree with don. IMHO, this is incredibly silly given Andrei's use case, since D can have

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Andrei Alexandrescu
On 12/10/10 4:10 PM, foobar wrote: Don Wrote: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of 'auto' is an abomination. I agree with don. IMHO, this is incredibly silly given Andrei's

Re: Destructors, const structs, and opEquals

2010-12-10 Thread so
I agree with don. IMHO, this is incredibly silly given Andrei's use case, since D can have instead: void foo(const Widget); and have an optimization inside the compiler for value types to pass by ref. by specifying const ref you explicitly require that only a ref to an l-value be

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Michel Fortin
On 2010-12-10 17:12:16 -0500, Don nos...@nospam.com said: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of 'auto' is an abomination. One problem I'm starting to realize is that we now have

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Andrei Alexandrescu
On 12/10/10 6:25 PM, Michel Fortin wrote: On 2010-12-10 17:12:16 -0500, Don nos...@nospam.com said: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of 'auto' is an abomination. One problem

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Andrei Alexandrescu
On 12/10/10 6:25 PM, Michel Fortin wrote: On 2010-12-10 17:12:16 -0500, Don nos...@nospam.com said: Steven Schveighoffer wrote: To summarize for those looking for the C++ behavior, the equivalent would be: void foo(auto ref const Widget) That use of 'auto' is an abomination. One problem

Re: Destructors, const structs, and opEquals

2010-12-10 Thread Michel Fortin
On 2010-12-10 21:28:43 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org said: On 12/10/10 6:25 PM, Michel Fortin wrote: One problem I'm starting to realize is that we now have so many available qualifiers for function parameters than it's really easy to get lost. In D1 it was simple:

Re: Destructors, const structs, and opEquals

2010-12-06 Thread Steven Schveighoffer
On Sun, 05 Dec 2010 09:18:13 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/5/10 12:04 AM, Steven Schveighoffer wrote: I'm totally confused. I thought the point of auto ref was to pass by value if it's an rvalue (since the data is already on the stack). If this is not

Re: Destructors, const structs, and opEquals

2010-12-05 Thread spir
On Sat, 04 Dec 2010 23:36:22 -0500 Steven Schveighoffer schvei...@yahoo.com wrote: No no no, inout does not belong here. Use const. inout is only used if you are returning a portion of the arguments. That should be a hard rule by the compiler (error). Fixed: bool opEquals(auto ref

Re: Destructors, const structs, and opEquals

2010-12-05 Thread Olivier Pisano
Le 04/12/2010 10:00, Franciszek Czekala a écrit : Anyway, if struct has value semantics then perhaps the argument to opEquals should have simply 'in' mode? In Ada95 the 'in' mode of the arguments does not determine how the arguments are passed internally to the function. The compiler can choose

Re: Destructors, const structs, and opEquals

2010-12-05 Thread so
Huh? I don't think you understand what I mean. inout only implicitly converts to const. Example: struct S { bool opEquals(S rhs){return false;} } struct T { S s; bool opEquals(auto ref inout T rhs) inout { return s == rhs.s; // error, cannot call S.opEquals(S rhs) with

Re: Destructors, const structs, and opEquals

2010-12-05 Thread Andrei Alexandrescu
On 12/5/10 12:06 AM, Steven Schveighoffer wrote: On Sun, 05 Dec 2010 00:42:20 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Yah, still not getting the original point there. I responded better in another part of this thread. Basically, inout doesn't mean what you think it

Re: Destructors, const structs, and opEquals

2010-12-05 Thread Andrei Alexandrescu
On 12/5/10 12:04 AM, Steven Schveighoffer wrote: I'm totally confused. I thought the point of auto ref was to pass by value if it's an rvalue (since the data is already on the stack). If this is not the case, then why not just make ref work that way? Why wouldn't I mark all my functions as auto

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Franciszek Czekala
Officially, opEquals has to have the signature: struct Foo { bool opEquals(const ref Foo x) const {...} } But this disallows comparisons with rvalues. eg, Foo bar() { Foo x = 1; return x; } Foo y=1; assert( y == bar() ); // doesn't compile You can get around this by declaring a

in and argument passing (was Re: Destructors, const structs, and opEquals)

2010-12-04 Thread spir
On Sat, 4 Dec 2010 09:00:05 + (UTC) Franciszek Czekala h...@valentimex.com wrote: Anyway, if struct has value semantics then perhaps the argument to opEquals should have simply 'in' mode? In Ada95 the 'in' mode of the arguments does not determine how the arguments are passed internally to

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Jonathan M Davis
On Friday 03 December 2010 22:42:06 Don wrote: (1) Should temporaries be allowed to be passed as 'const ref'? I honestly do not understand why they can't be already. C++ definitely allows this. Is there something bad about it? I'd probably use const ref a lot more, but because it will only

Re: Destructors, const structs, and opEquals

2010-12-04 Thread so
On Friday 03 December 2010 22:42:06 Don wrote: (1) Should temporaries be allowed to be passed as 'const ref'? I honestly do not understand why they can't be already. C++ definitely allows this. If you don't mean new C++ standards, this is not true. It is supported by non-standard

Re: Destructors, const structs, and opEquals

2010-12-04 Thread so
I'm a bit uncertain as to how this is all supposed to work. (1) Should temporaries be allowed to be passed as 'const ref'? Rather, what keeps compiler from interpreting A fun() like const ref A fun() when it is necessary? After all D's const system has no holes in this case unlike C++. --

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Jonathan M Davis
On Saturday 04 December 2010 03:49:26 so wrote: On Friday 03 December 2010 22:42:06 Don wrote: (1) Should temporaries be allowed to be passed as 'const ref'? I honestly do not understand why they can't be already. C++ definitely allows this. If you don't mean new C++ standards,

Re: Destructors, const structs, and opEquals

2010-12-04 Thread so
I'm 99.99% certain that it's perfectly legal to pass a temporary to a function that takes a const T and that it's in the standard Oh that is right, but both are different things. Say, when you have: T fun() {...} void bar(const T) {...} bar(fun()) // 1. this is perfectly legal. const T a =

Re: Destructors, const structs, and opEquals

2010-12-04 Thread so
I'm a bit uncertain as to how this is all supposed to work. (1) Should temporaries be allowed to be passed as 'const ref'? Oh... we are saying exact same thing but i interpreted passed as 'const ref' out of the context! I guess Jonathan also saying the same thing. Sorry about that! --

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrei Alexandrescu
On 12/4/10 4:35 AM, Jonathan M Davis wrote: On Friday 03 December 2010 22:42:06 Don wrote: (1) Should temporaries be allowed to be passed as 'const ref'? I honestly do not understand why they can't be already. C++ definitely allows this. C++'s second biggest mistake. Andrei

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrei Alexandrescu
On 12/4/10 6:50 AM, so wrote: I'm 99.99% certain that it's perfectly legal to pass a temporary to a function that takes a const T and that it's in the standard Oh that is right, but both are different things. Say, when you have: T fun() {...} void bar(const T) {...} bar(fun()) // 1. this is

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrei Alexandrescu
On 12/4/10 12:42 AM, Don wrote: Officially, opEquals has to have the signature: struct Foo { bool opEquals(const ref Foo x) const {...} } This is a compiler bug. For structs there should be no official implementation of opEquals, opCmp etc. All the compiler needs to worry about is to

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Jonathan M Davis
On Saturday 04 December 2010 06:00:58 Andrei Alexandrescu wrote: On 12/4/10 4:35 AM, Jonathan M Davis wrote: On Friday 03 December 2010 22:42:06 Don wrote: (1) Should temporaries be allowed to be passed as 'const ref'? I honestly do not understand why they can't be already. C++

Re: Destructors, const structs, and opEquals

2010-12-04 Thread so
On Sat, 04 Dec 2010 16:05:07 +0200, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/4/10 6:50 AM, so wrote: I'm 99.99% certain that it's perfectly legal to pass a temporary to a function that takes a const T and that it's in the standard Oh that is right, but both are

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrei Alexandrescu
On 12/4/10 8:29 AM, Jonathan M Davis wrote: On Saturday 04 December 2010 06:00:58 Andrei Alexandrescu wrote: On 12/4/10 4:35 AM, Jonathan M Davis wrote: On Friday 03 December 2010 22:42:06 Don wrote: (1) Should temporaries be allowed to be passed as 'const ref'? I honestly do not understand

Re: Destructors, const structs, and opEquals

2010-12-04 Thread so
i would take take the address of a temporary function... Should be: i would take the address of a temporary object/value. -- Using Opera's revolutionary email client: http://www.opera.com/mail/

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Don
Andrei Alexandrescu wrote: On 12/4/10 12:42 AM, Don wrote: Officially, opEquals has to have the signature: struct Foo { bool opEquals(const ref Foo x) const {...} } This is a compiler bug. For structs there should be no official implementation of opEquals, opCmp etc. All the compiler needs

Re: Destructors, const structs, and opEquals

2010-12-04 Thread kenji hara
Andrei, your explanation is almost the same as was my understanding. Thank you. My shallow thought: const T makes automatically reference. It is convenient. Right thinking: D has no semantics dividing copying/referencing, against has dividing rvalue/lvalue. D should support this like

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrei Alexandrescu
On 12/4/10 9:23 AM, Don wrote: Andrei Alexandrescu wrote: On 12/4/10 12:42 AM, Don wrote: Officially, opEquals has to have the signature: struct Foo { bool opEquals(const ref Foo x) const {...} } This is a compiler bug. For structs there should be no official implementation of opEquals,

Re: Destructors, const structs, and opEquals

2010-12-04 Thread so
bool opEquals(auto ref inout Tuple rhs) inout { foreach (i, T; Types) { if (this[i] != rhs[i]) return false; } return true; } It looks a bit alembicated but let's not forget that Tuple is supposed to be very flexible and to do a lot of things. Const-system is a one big

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrej Mitrovic
Keyword cocktails.. 2010/12/4 so s...@so.do: bool opEquals(auto ref inout Tuple rhs) inout {   foreach (i, T; Types) {     if (this[i] != rhs[i]) return false;   }   return true; } It looks a bit alembicated but let's not forget that Tuple is supposed to be very flexible and to do a lot

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Don
Andrei Alexandrescu wrote: On 12/4/10 9:23 AM, Don wrote: Andrei Alexandrescu wrote: On 12/4/10 12:42 AM, Don wrote: Officially, opEquals has to have the signature: struct Foo { bool opEquals(const ref Foo x) const {...} } This is a compiler bug. For structs there should be no official

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrei Alexandrescu
On 12/4/10 2:39 PM, Don wrote: Andrei Alexandrescu wrote: On 12/4/10 9:23 AM, Don wrote: Andrei Alexandrescu wrote: On 12/4/10 12:42 AM, Don wrote: Officially, opEquals has to have the signature: struct Foo { bool opEquals(const ref Foo x) const {...} } This is a compiler bug. For structs

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Steven Schveighoffer
On Sat, 04 Dec 2010 11:00:58 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/4/10 9:23 AM, Don wrote: Andrei Alexandrescu wrote: On 12/4/10 12:42 AM, Don wrote: Officially, opEquals has to have the signature: struct Foo { bool opEquals(const ref Foo x) const {...} }

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrei Alexandrescu
On 12/4/10 22:42 CST, Steven Schveighoffer wrote: On Sat, 04 Dec 2010 15:58:43 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/4/10 2:39 PM, Don wrote: Andrei Alexandrescu wrote: On 12/4/10 9:23 AM, Don wrote: Andrei Alexandrescu wrote: On 12/4/10 12:42 AM, Don wrote:

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrei Alexandrescu
On 12/4/10 22:36 CST, Steven Schveighoffer wrote: On Sat, 04 Dec 2010 11:00:58 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/4/10 9:23 AM, Don wrote: Andrei Alexandrescu wrote: On 12/4/10 12:42 AM, Don wrote: Officially, opEquals has to have the signature: struct

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Andrei Alexandrescu
On 12/4/10 23:40 CST, Andrei Alexandrescu wrote: Yah. Method calls are already passed by reference (I'd prefer not but that's just me). Sorry, I meant: method calls are already allowed for rvalues. Sleepy... Andrei

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Steven Schveighoffer
On Sun, 05 Dec 2010 00:40:26 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/4/10 22:36 CST, Steven Schveighoffer wrote: On Sat, 04 Dec 2010 11:00:58 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 12/4/10 9:23 AM, Don wrote: Andrei Alexandrescu

Re: Destructors, const structs, and opEquals

2010-12-04 Thread Steven Schveighoffer
On Sun, 05 Dec 2010 00:42:20 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Yah, still not getting the original point there. I responded better in another part of this thread. Basically, inout doesn't mean what you think it means. -Steve