Skip to content

Commit d372ecc

Browse files
committed
AtomicOrLocked: use std::conditional_t and std::is_trivially_copyable_v
std::conditional_t was added in C++14, is_trivially_copyable_v in C++17, both do the same as the previous implementation and are a bit more compact.
1 parent a2dc350 commit d372ecc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/base/atomic.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Locked
109109
* @ingroup base
110110
*/
111111
template <typename T>
112-
using AtomicOrLocked = typename std::conditional<std::is_trivially_copyable<T>::value, std::atomic<T>, Locked<T>>::type;
112+
using AtomicOrLocked = std::conditional_t<std::is_trivially_copyable_v<T>, std::atomic<T>, Locked<T>>;
113113

114114
}
115115

0 commit comments

Comments
 (0)