This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++0x] Range-based for statements and ADL


On 17 March 2011 20:10, Jonathan Wakely wrote:
> On 17 March 2011 20:00, Rodrigo Rivas wrote:
>>> Yes, I was just trying exactly that improvement.
>> How about this?
>
> Nice. ?The comments should be changed too:
>
> ? If RANGE_EXPR is an array:
> ? ? ? BEGIN_EXPR = __range
> ? ? ? END_EXPR = __range + ARRAY_SIZE(__range)
> ? Else if __range.begin() or __range.end() is value

erk ... "is valid:" not "is value" !

> ? ? ? ?BEGIN_EXPR = __range.begin()
> ? ? ? ?END_EXPR = __range.end();
> ? Else:
> ? ? ? ?BEGIN_EXPR = begin(__range)
> ? ? ? ?END_EXPR = end(__range);
> ...
>
> ? ? ? ? ?/* If it is not an array, we must call __range.begin()/__range.end()
> ? ? ? ? ? ? if either exists, or begin(__range)/end(__range) otherwise. ?*/
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]