On Wed, Oct 22, 2014 at 6:05 PM, Marshall Clow <[email protected]>
wrote:

>
> On Sep 16, 2014, at 2:13 PM, David Blaikie <[email protected]> wrote:
>
>
>
> On Tue, Sep 16, 2014 at 1:38 PM, Marshall Clow <[email protected]>
> 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.
>

Right - but what I mean is if the definition was "= deleted" you'd get
compilation errors from the tests for std::mismatch before the (void) casts
were added, right? I figured it just might be a lower-cost way to test (not
needing to execute code) and give possibly easier to track down errors to
fix algorithms that weren't comma overload safe.

- David



>
> — Marshall
>
>
>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to