On Thu, 20 Feb 2014 13:04:55 -0000, w0rp <devw...@gmail.com> wrote:

I don't think this is a good idea.

Which part? The initial solution to my initial problem, or one of the 3 schemes mentioned?

Say you have a class with range methods and add opApply later. Only the opApply delegate receives a type other than size_t for the first argument. Now the foreach line infers a differnt type for i and code in the outside world will break.

Only if the compiler prefers opApply to range methods, does it?

And, if it prefers range methods then any existing class with opApply (with more than 1 variable) that gets range methods will break also, because foreach(<more than 1 variable>; range) does not (currently) work.

More importantly, this gets in the way of behaviour which may be desirable later, foreach being able to unpack tuples from ranges.

<snip> :)

R

--
Using Opera's revolutionary email client: http://www.opera.com/mail/

Reply via email to