[libcxx] r217902 - Create a 'comma_iterator' class that overloads operator, and asserts when it's called. Add tests to mismatch to make sure it can't be blindsided by such an evil iterator. More tests for other algorithms forthcoming. Thanks to STL for pointing this out at CppCon and Yakov Galka for opening LWG issue #2133
Marshall Clow
mclow.lists at gmail.com
Wed Oct 22 18:05:12 PDT 2014
On Sep 16, 2014, at 2:13 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
> On Tue, Sep 16, 2014 at 1:38 PM, Marshall Clow <mclow.lists at gmail.com> wrote:
> Author: marshall
> Date: Tue Sep 16 15:38:11 2014
> New Revision: 217902
>
> URL: http://llvm.org/viewvc/llvm-project?rev=217902&view=rev
> Log:
> Create a 'comma_iterator' class that overloads operator, and asserts when it's called. Add tests to mismatch to make sure it can't be blindsided by such an evil iterator. More tests for other algorithms forthcoming. Thanks to STL for pointing this out at CppCon and Yakov Galka for opening LWG issue #2133
>
> Could it use "= delete" to make this test fail at compile-time?
Sorry I didn’t respond before.
The point here is not that this should fail to compile, but rather that such evil iterators should work with the standard algorithms.
See http://llvm.org/viewvc/llvm-project?rev=217903&view=rev for a change to std::mismatch to work correctly.
— Marshall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141022/ad5187cb/attachment.html>
More information about the cfe-commits
mailing list