Add ContainerT&& ctors to sorted_vector_map and sorted_vector_set.
authorMark Logan <mlogan@fb.com>
Fri, 3 Feb 2017 18:09:57 +0000 (10:09 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 3 Feb 2017 18:18:01 +0000 (10:18 -0800)
commitb90498bc90c4b327fa9877d6a395c0483f4dd686
tree5035fabf2c0f5e42366594fde6b43cdcdf6d29ca
parent3ffcb010fb7333a9ad6b233b47e1ecfdfb0fc2f0
Add ContainerT&& ctors to sorted_vector_map and sorted_vector_set.

Summary:
Add ContainerT&& ctors to sorted_vector_map and sorted_vector_set,
to support more efficient bulk-construction of these containers. With the
prior constructors, the only way to do bulk-construction efficiently was
by using the iterator constructors with a pre-sorted range. If you didn't
have a presorted range, you would need to make a temporary container in
order to get a sorted range. Repeatedly calling insert() without a sorted
range is quadratic, hence not an option.

Reviewed By: yfeldblum

Differential Revision: D4491299

fbshipit-source-id: 041c546578f44ee6928c5506e8d8191092143b12
folly/sorted_vector_types.h
folly/test/sorted_vector_test.cpp