Skip to content

Commit 41150c8

Browse files
committed
Move mandates check __atomic/{support.h -> atomic.h}
1 parent d579645 commit 41150c8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

libcxx/include/__atomic/atomic.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,14 @@ struct __atomic_waitable_traits<__atomic_base<_Tp, _IsIntegral> > {
230230
}
231231
};
232232

233+
template <typename _Tp>
234+
struct __check_atomic_mandates {
235+
using type = _Tp;
236+
static_assert(is_trivially_copyable<_Tp>::value, "std::atomic<T> requires that 'T' be a trivially copyable type");
237+
};
238+
233239
template <class _Tp>
234-
struct atomic : public __atomic_base<_Tp> {
240+
struct atomic : public __atomic_base<typename __check_atomic_mandates<_Tp>::type> {
235241
using __base _LIBCPP_NODEBUG = __atomic_base<_Tp>;
236242

237243
#if _LIBCPP_STD_VER >= 20

libcxx/include/__atomic/support.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,7 @@
111111

112112
_LIBCPP_BEGIN_NAMESPACE_STD
113113

114-
template <typename _Tp>
115-
struct __check_atomic_mandates {
116-
using type = _Tp;
117-
static_assert(is_trivially_copyable<_Tp>::value, "std::atomic<T> requires that 'T' be a trivially copyable type");
118-
};
119-
120-
template <typename _Tp, typename _Base = __cxx_atomic_base_impl<typename __check_atomic_mandates<_Tp>::type> >
114+
template <typename _Tp, typename _Base = __cxx_atomic_base_impl<_Tp> >
121115
struct __cxx_atomic_impl : public _Base {
122116
_LIBCPP_HIDE_FROM_ABI __cxx_atomic_impl() _NOEXCEPT = default;
123117
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __cxx_atomic_impl(_Tp __value) _NOEXCEPT : _Base(__value) {}

0 commit comments

Comments
 (0)