File indexing completed on 2025-01-18 10:07:39
0001
0002
0003
0004 #ifndef QTCORE_QSWAP_H
0005 #define QTCORE_QSWAP_H
0006
0007 #include <QtCore/qtconfigmacros.h>
0008
0009 #include <type_traits>
0010 #include <utility>
0011
0012 #if 0
0013 #pragma qt_class(QtSwap)
0014 #pragma qt_sync_stop_processing
0015 #endif
0016
0017 QT_BEGIN_NAMESPACE
0018
0019 template <typename T>
0020 constexpr void qSwap(T &value1, T &value2)
0021 noexcept(std::is_nothrow_swappable_v<T>)
0022 {
0023 using std::swap;
0024 swap(value1, value2);
0025 }
0026
0027
0028 template <typename T>
0029 constexpr inline void qt_ptr_swap(T* &lhs, T* &rhs) noexcept
0030 {
0031 T *tmp = lhs;
0032 lhs = rhs;
0033 rhs = tmp;
0034 }
0035
0036 QT_END_NAMESPACE
0037
0038 #endif