Re: Possible range based 'for' bug

2015-06-22 Thread Jonathan Wakely
On 22 June 2015 at 10:18, Paulo Matos wrote: > > >> -Original Message- >> From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf >> Of Julian Klappenbach >> Sent: 21 June 2015 16:56 >> To: gcc@gcc.gnu.org >> Subject: Re: Possibl

RE: Possible range based 'for' bug

2015-06-22 Thread Paulo Matos
> -Original Message- > From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf > Of Julian Klappenbach > Sent: 21 June 2015 16:56 > To: gcc@gcc.gnu.org > Subject: Re: Possible range based 'for' bug > > Version info: > > Configured

Re: Possible range based 'for' bug

2015-06-21 Thread Jonathan Wakely
On 21 June 2015 at 19:16, Julian Klappenbach wrote: > The issue occurred to me after I sent the email. > > begin() / end() return iterators by value, not reference. > > So, you're correct in identifying the value / reference issue. But to > be precise: you can't return an abstract class type *by

Re: Possible range based 'for' bug

2015-06-21 Thread Julian Klappenbach
The issue occurred to me after I sent the email. begin() / end() return iterators by value, not reference. So, you're correct in identifying the value / reference issue. But to be precise: you can't return an abstract class type *by value* from a function. If the return values of begin() / end

Re: Possible range based 'for' bug

2015-06-21 Thread Jonathan Wakely
On 21 June 2015 at 16:56, Julian Klappenbach wrote: > Version info: > > Configured with: > --prefix=/Applications/Xcode.app/Contents/Developer/usr > --with-gxx-include-dir=/usr/include/c++/4.2.1 > Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) > Target: x86_64-apple-darwin14.3.0

Re: Possible range based 'for' bug

2015-06-21 Thread Julian Klappenbach
Version info: Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix I'm using the default build provided by bre