Fix "Non-const reference cannot bind to bit-field" diagnostic

This commit is contained in:
PeakKS 2025-03-02 14:07:43 -05:00
parent aea94b32cb
commit 71e408728b

View file

@ -137,8 +137,9 @@ void CUtlBlockMemory<T,I>::Swap( CUtlBlockMemory< T, I > &mem )
{
V_swap( m_pMemory, mem.m_pMemory );
V_swap( m_nBlocks, mem.m_nBlocks );
V_swap( m_nIndexMask, mem.m_nIndexMask );
V_swap( m_nIndexShift, mem.m_nIndexShift );
// Casts fix "Non-const reference cannot bind to bit-field" error
V_swap( (int &)m_nIndexMask, (int &)mem.m_nIndexMask );
V_swap( (int &)m_nIndexShift, (int &)mem.m_nIndexShift );
}