Re: Passing rvalues to functions expecting const ref

2012-12-23 Thread Minas Mina
On Sunday, 23 December 2012 at 20:40:09 UTC, Namespace wrote: Minas Mina: Show me the whole code, I think that your opBinary functions returns rvalues. This would be a good and important case for "auto ref". But until now it is only for template paramters... struct Vector3 { float x,

Re: Passing rvalues to functions expecting const ref

2012-12-23 Thread Namespace
On Sunday, 23 December 2012 at 18:32:47 UTC, John Chapman wrote: On Sunday, 23 December 2012 at 12:08:47 UTC, Namespace wrote: As long as you use structs this should work, as you can see here: http://dpaste.dzfl.pl/03adf3d1 But if you use classes, it does not work anymore. So I like it a lot, t

Re: Passing rvalues to functions expecting const ref

2012-12-23 Thread John Chapman
On Sunday, 23 December 2012 at 12:08:47 UTC, Namespace wrote: As long as you use structs this should work, as you can see here: http://dpaste.dzfl.pl/03adf3d1 But if you use classes, it does not work anymore. So I like it a lot, that it works with structs. :) I don't think this will work after

Re: Passing rvalues to functions expecting const ref

2012-12-23 Thread Minas Mina
On Sunday, 23 December 2012 at 12:08:47 UTC, Namespace wrote: As long as you use structs this should work, as you can see here: http://dpaste.dzfl.pl/03adf3d1 But if you use classes, it does not work anymore. So I like it a lot, that it works with structs. :) Thank you. I had forgotten to supp

Re: Passing rvalues to functions expecting const ref

2012-12-23 Thread Namespace
As long as you use structs this should work, as you can see here: http://dpaste.dzfl.pl/03adf3d1 But if you use classes, it does not work anymore. So I like it a lot, that it works with structs. :)