Skip to content

Commit 2165aa4

Browse files
committed
[orc-rt] Tidy up some type_traits uses. NFC.
1 parent 2daa2f1 commit 2165aa4

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

orc-rt/include/orc-rt/Error.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class ORC_RT_NODISCARD Error {
114114
void setChecked(bool Checked) { ErrPtr = (ErrPtr & ~uintptr_t(1)) | Checked; }
115115

116116
template <typename ErrT = ErrorInfoBase> std::unique_ptr<ErrT> takePayload() {
117-
static_assert(std::is_base_of<ErrorInfoBase, ErrT>::value,
117+
static_assert(std::is_base_of_v<ErrorInfoBase, ErrT>,
118118
"ErrT is not an ErrorInfoBase subclass");
119119
std::unique_ptr<ErrT> Tmp(getPtr<ErrT>());
120120
setPtr(nullptr);
@@ -292,7 +292,7 @@ template <typename T> class ORC_RT_NODISCARD Expected {
292292

293293
template <class OtherT> friend class Expected;
294294

295-
static constexpr bool IsRef = std::is_reference<T>::value;
295+
static constexpr bool IsRef = std::is_reference_v<T>;
296296
using wrap = std::reference_wrapper<std::remove_reference_t<T>>;
297297
using error_type = std::unique_ptr<ErrorInfoBase>;
298298
using storage_type = std::conditional_t<IsRef, wrap, T>;
@@ -313,7 +313,7 @@ template <typename T> class ORC_RT_NODISCARD Expected {
313313
/// Create an Expected from a T value.
314314
template <typename OtherT>
315315
Expected(OtherT &&Val,
316-
std::enable_if_t<std::is_convertible<OtherT, T>::value> * = nullptr)
316+
std::enable_if_t<std::is_convertible_v<OtherT, T>> * = nullptr)
317317
: HasError(false), Unchecked(true) {
318318
new (getStorage()) storage_type(std::forward<OtherT>(Val));
319319
}
@@ -324,9 +324,8 @@ template <typename T> class ORC_RT_NODISCARD Expected {
324324
/// Move construct an Expected<T> value from an Expected<OtherT>, where OtherT
325325
/// must be convertible to T.
326326
template <class OtherT>
327-
Expected(
328-
Expected<OtherT> &&Other,
329-
std::enable_if_t<std::is_convertible<OtherT, T>::value> * = nullptr) {
327+
Expected(Expected<OtherT> &&Other,
328+
std::enable_if_t<std::is_convertible_v<OtherT, T>> * = nullptr) {
330329
moveConstruct(std::move(Other));
331330
}
332331

@@ -335,7 +334,7 @@ template <typename T> class ORC_RT_NODISCARD Expected {
335334
template <class OtherT>
336335
explicit Expected(
337336
Expected<OtherT> &&Other,
338-
std::enable_if_t<!std::is_convertible<OtherT, T>::value> * = nullptr) {
337+
std::enable_if_t<!std::is_convertible_v<OtherT, T>> * = nullptr) {
339338
moveConstruct(std::move(Other));
340339
}
341340

0 commit comments

Comments
 (0)