From df8f0a21779fb2501a6396d7f66bf899835d3347 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 20 May 2011 03:52:03 +0000 Subject: [PATCH] Break API: _foreach now iterates values, not iterators. --- stdlib.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib.h b/stdlib.h index 021ae70..9258221 100644 --- a/stdlib.h +++ b/stdlib.h @@ -114,7 +114,9 @@ struct Iterator_ { #define _foreach(item, list) \ for (bool _stop(true); _stop; ) \ for (const __typeof__(list) &_list = (list); _stop; _stop = false) \ - for (Iterator_<__typeof__(list)>::Result item = _list.begin(); item != _list.end(); ++item) + for (Iterator_<__typeof__(list)>::Result _item = _list.begin(); _item != _list.end(); ++_item) \ + for (bool _suck(true); _suck; ) \ + for (const __typeof__(*_item) &item = *_item; _suck; _suck = false) #endif -- 2.45.2