
13 Apr
2004
13 Apr
'04
12:50 a.m.
"Brian McNamara" <lorgon@cc.gatech.edu> wrote in message news:20040412152352.GA1822@gaia2.cc.gatech.edu... [snip]
What's an example use-case? I don't recall ever needing/wanting this.
My initial use-case was to use it in mutating container algorithms. Without it you would have to create a temporary, even though you didn't need it (and hardcoding the return-type is messy). So it would have been optimal just to hand the result of function to new functions even though they mutate, eg vector<int> vec(); my_copy( my_sort( my_unique( vec() ) ), ostream_iterator<int>( cout ) ); instead of vector<int> temp1( vec() ); vector<int> temp2( my_unique( temp1 ) ); my_copy( my_sort( temp2 ), .... ) br Thorsten