aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/MathExtrasTest.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-09-11 07:54:20 -0700
committerGitHub <noreply@github.com>2025-09-11 07:54:20 -0700
commit808f5d13b32c4280d186880a676f6be6b02b8fda (patch)
treef4e87fe69c3be5cd386c79188021a942ad16d945 /llvm/unittests/Support/MathExtrasTest.cpp
parent648831b210bd51f50858761b552ddca3071cf4e1 (diff)
downloadllvm-808f5d13b32c4280d186880a676f6be6b02b8fda.zip
llvm-808f5d13b32c4280d186880a676f6be6b02b8fda.tar.gz
llvm-808f5d13b32c4280d186880a676f6be6b02b8fda.tar.bz2
[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.
Diffstat (limited to 'llvm/unittests/Support/MathExtrasTest.cpp')
0 files changed, 0 insertions, 0 deletions