First half (set/multiset) of N3657

Marshall Clow mclow.lists at gmail.com
Mon Aug 12 11:06:03 PDT 2013


Adding Heterogenous comparison lookups to associative containers.

In this patch:
* Marking the comparison functions as transparent (thanks Zhihao!)
* Updating the synopsis in <set>
* Defining the four template functions (find, equal_range, upper_bound, and lower_bound) in set/multiset
* enable_if-ing them for transparent comparison functions.
* added a utility class named "PrivateConstructor" to test these things.
* Tests. Lots of guns - I mean tests.

Howard has already suggested an enhancement to the enable if to deal with the case where there's an implicit conversion from the key type being passed to find() and the key type of the container. This should work in C++11, and it would be nice if it continued to work.

Still to do: map and multi-map.

-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists at gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: n3657-1.patch
Type: application/octet-stream
Size: 48060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130812/b633006c/attachment.obj>


More information about the cfe-commits mailing list