Commit 6fcea2fc authored by Nicholas Ormrod's avatar Nicholas Ormrod Committed by Facebook GitHub Bot

Mark sorted_vector swap as conditionally noexcept

Summary: swap should be noexcept when possible

Reviewed By: yfeldblum

Differential Revision: D33198827

fbshipit-source-id: f8d52a21087b0346332359b66e1dc00f982ddbbb
parent 16a0583c
......@@ -594,8 +594,9 @@ class sorted_vector_set : detail::growth_policy_wrapper<GrowthPolicy> {
return std::equal_range(begin(), end(), key, key_comp());
}
// Nothrow as long as swap() on the Compare type is nothrow.
void swap(sorted_vector_set& o) {
void swap(sorted_vector_set& o) noexcept(
IsNothrowSwappable<Compare>::value&& noexcept(
std::declval<Container&>().swap(o.m_.cont_))) {
using std::swap; // Allow ADL for swap(); fall back to std::swap().
Compare& a = m_;
Compare& b = o.m_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment