sorted_vector_types does not work with std::inserter
authorMarc Celani <marccelani@fb.com>
Sun, 16 Mar 2014 03:00:45 +0000 (20:00 -0700)
committerDave Watson <davejwatson@fb.com>
Tue, 18 Mar 2014 17:02:24 +0000 (10:02 -0700)
commitc3633870bb96623fc188f2fb2564dbf18c58a2e9
tree44c520a0c70d4cd2df5742fc1d38bed7bc564927
parentb2d3a93b2a2bac05087d4294dc09d59cca64c90e
sorted_vector_types does not work with std::inserter

Summary:
The signature of insert(hint, const val& v) is wrong. It should return an iterator, not pair<iterator, bool>. This breaks std::inserter, making it impossible to use this for std::merge. I plan to create folly::merge (std::merge with stronger semantics when equal values are present in the two input ranges), so I need this fixed.

Given that the documentation claims this is a "drop in replacement" for std::map, I figure we should fix this.

Test Plan: reran unit tests

Reviewed By: delong.j@fb.com

FB internal diff: D1223396
folly/sorted_vector_types.h