Skip to content

Commit 8df52ed

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 33b5ed8 commit 8df52ed

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
@@ -71,7 +71,7 @@ class Locked
7171
* @ingroup base
7272
*/
7373
template <typename T>
74-
using AtomicOrLocked = typename std::conditional<std::is_trivially_copyable<T>::value, std::atomic<T>, Locked<T>>::type;
74+
using AtomicOrLocked = std::conditional_t<std::is_trivially_copyable_v<T>, std::atomic<T>, Locked<T>>;
7575

7676
}
7777

0 commit comments

Comments
 (0)