Fix: Port to macOS 15.5 (Sequoia) – clang++ compatibility, std::swap, Data() templating

This commit is contained in:
Maikel Maes 2025-06-19 14:25:40 +02:00
parent 29985681a1
commit 59bd2a104c
2 changed files with 13 additions and 4 deletions

View File

@ -105,6 +105,9 @@ public:
// NULL check
bool operator!() const;
// Returns the underlying DmElementHandle_t data
const DmElementHandle_t& Data() const;
// Assignment.. wish I knew how to un-inline these methods
template <class S> CDmaElement<T> &operator=( S* pElement )
{
@ -1136,6 +1139,12 @@ inline void CDmaElement<T>::InitAndCreate( CDmElement *pOwner, const char *pAttr
m_pAttribute->AddFlag( flags | FATTRIB_MUSTCOPY );
}
template <class T>
inline const DmElementHandle_t& CDmaElement<T>::Data() const
{
return Value();
}
template <class T>
inline void CDmaElement<T>::Init( CDmElement *pOwner, const char *pAttributeName, int flags )
{

View File

@ -137,10 +137,10 @@ CUtlBlockMemory<T,I>::~CUtlBlockMemory()
template< class T, class I >
void CUtlBlockMemory<T,I>::Swap( CUtlBlockMemory< T, I > &mem )
{
this->swap( m_pMemory, mem.m_pMemory );
this->swap( m_nBlocks, mem.m_nBlocks );
this->swap( m_nIndexMask, mem.m_nIndexMask );
this->swap( m_nIndexShift, mem.m_nIndexShift );
std::swap( m_pMemory, mem.m_pMemory );
std::swap( m_nBlocks, mem.m_nBlocks );
std::swap( m_nIndexMask, mem.m_nIndexMask );
std::swap( m_nIndexShift, mem.m_nIndexShift );
}