Re: *in* vs *const ref*

2012-11-07 Thread Dan
Very clear and much appreciated. On Tuesday, 6 November 2012 at 23:38:00 UTC, Jonathan M Davis wrote: If a function requires an lvalue, then you have to pass a [snip] You'd have to do something like string file = __FILE__; size_t line = __LINE__; auto f = foo(); auto b = bar(7);

*in* vs *const ref*

2012-11-06 Thread Dan
Googling to see differences between *in* and *const ref* I found detailed explanation here: http://stackoverflow.com/questions/8515579/difference-between-const-ref-and-in One response is: If you have identified the copying as a bottleneck and you want to optimize, using *const ref* is a good

Re: *in* vs *const ref*

2012-11-06 Thread Jonathan M Davis
On Tuesday, November 06, 2012 22:52:53 Dan wrote: Later on another response is: A huge difference between *in* and *const ref* which you don't cover at all is the fact that *const ref* must take an lvalue, whereas *in* doesn't have to Why is this benefit huge? Is it just the convenience of