You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ADT] Simplify a constructor of iterator_range (NFC) (#158005)
Without this patch, we determine whether one iterator type can be
converted to another in a roundabout way. Specifically,
explicitly_convertible uses std::void_t to determine whether the given
conversion expression is well formed, yielding
std::true_type/std::false_type. Then the boolean value is passed to
std::enable_if_t to obtain void again. That is, we are doing a
roundtrip from void to a boolean value and back.
This patch removes the roundtrip by directly using std::void_t inside
the constructor's template parameter list.
Now, explicitly_converted_t is very similar to std::is_constructible,
but there a couple of corner cases where they evaluate to different
values. For now, this patch sticks to the same expression
decltype(static_cast<To>(...)) to be safe.
0 commit comments