[cfe-commits] Mark virtual members used in a deterministic order

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Aug 26 20:35:19 PDT 2012


> Have you seen some structure like this before? Can you think of a way
> to make the iterator behave like a regular stl iterator?

Typing this I realized a way to do it: Have first and second in
FakePair be references. That way operator-> can return it by value,
but anyone using it will access the elements in the vector.

The structure still looks strange, but at least the code using it
looks the same as when using a stl container. Do you think I should
try to generalize this structure?

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 4691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120826/7ef8c3e2/attachment.obj>


More information about the cfe-commits mailing list