
12 Nov
2008
12 Nov
'08
9:59 p.m.
Steven Watanabe skrev:
AMDG
David Abrahams wrote:
Do you mean that I can detect the return type of operator[] at compile-time and do correct forwarding?
No, I mean you can detect when the return type of operator[] is the same as the reference type.
How do you distinguish const T& from T? If T is large, it is not necessarily a good idea to make extraneous copies if they can be avoided. Unlike iterator_facade, iterator_range doesn't make it easy to replace its version of operator[]...
I provided operator() for use when pass by value must be used. -Thorsten