diff --git a/include/Nazara/Core/Bitset.hpp b/include/Nazara/Core/Bitset.hpp index ccb7802ef..c359181cc 100644 --- a/include/Nazara/Core/Bitset.hpp +++ b/include/Nazara/Core/Bitset.hpp @@ -95,6 +95,7 @@ class NzBitset unsigned int FindFirstFrom(unsigned int blockIndex) const; Block GetLastBlockMask() const; void ResetExtraBits(); + static unsigned int ComputeBlockCount(unsigned int bitCount); static unsigned int GetBitIndex(unsigned int bit); static unsigned int GetBlockIndex(unsigned int bit); @@ -103,22 +104,22 @@ class NzBitset unsigned int m_bitCount; }; -template +template bool operator==(const NzBitset& lhs, const NzBitset& rhs); -template +template bool operator!=(const NzBitset& lhs, const NzBitset& rhs); -template +template NzBitset operator&(const NzBitset& lhs, const NzBitset& rhs); -template +template NzBitset operator|(const NzBitset& lhs, const NzBitset& rhs); -template +template NzBitset operator^(const NzBitset& lhs, const NzBitset& rhs); -template +template class NzBitset::Bit { friend NzBitset; diff --git a/include/Nazara/Core/Bitset.inl b/include/Nazara/Core/Bitset.inl index 73f84f9a6..254cf39d7 100644 --- a/include/Nazara/Core/Bitset.inl +++ b/include/Nazara/Core/Bitset.inl @@ -533,7 +533,7 @@ template unsigned int NzBitset::npos = std::numeric_limits::max(); -template +template bool operator==(const NzBitset& lhs, const NzBitset& rhs) { // La comparaison part du principe que (uint8) 00001100 == (uint16) 00000000 00001100 @@ -560,13 +560,13 @@ bool operator==(const NzBitset& lhs, const NzBitset +template bool operator!=(const NzBitset& lhs, const NzBitset& rhs) { return !(lhs == rhs); } -template +template NzBitset operator&(const NzBitset& lhs, const NzBitset& rhs) { NzBitset bitset; @@ -575,7 +575,7 @@ NzBitset operator&(const NzBitset& lhs, cons return bitset; } -template +template NzBitset operator|(const NzBitset& lhs, const NzBitset& rhs) { NzBitset bitset; @@ -584,7 +584,7 @@ NzBitset operator|(const NzBitset& lhs, cons return bitset; } -template +template NzBitset operator^(const NzBitset& lhs, const NzBitset& rhs) { NzBitset bitset; @@ -594,7 +594,7 @@ NzBitset operator^(const NzBitset& lhs, cons } -template +template typename NzBitset::Bit& NzBitset::Bit::Flip() { m_block ^= m_mask; @@ -602,13 +602,13 @@ typename NzBitset::Bit& NzBitset::Bit::Flip( return *this; } -template +template typename NzBitset::Bit& NzBitset::Bit::Reset() { return Set(false); } -template +template typename NzBitset::Bit& NzBitset::Bit::Set(bool val) { // https://graphics.stanford.edu/~seander/bithacks.html#ConditionalSetOrClearBitsWithoutBranching @@ -617,13 +617,13 @@ typename NzBitset::Bit& NzBitset::Bit::Set(b return *this; } -template +template bool NzBitset::Bit::Test() const { return m_block & m_mask; } -template +template template void* NzBitset::Bit::operator&() const { @@ -633,25 +633,25 @@ void* NzBitset::Bit::operator&() const return nullptr; } -template +template NzBitset::Bit::operator bool() const { return Test(); } -template +template typename NzBitset::Bit& NzBitset::Bit::operator=(bool val) { return Set(val); } -template +template typename NzBitset::Bit& NzBitset::Bit::operator=(const Bit& bit) { return Set(bit); } -template +template typename NzBitset::Bit& NzBitset::Bit::operator|=(bool val) { // Version sans branching: @@ -666,7 +666,7 @@ typename NzBitset::Bit& NzBitset::Bit::opera return *this; } -template +template typename NzBitset::Bit& NzBitset::Bit::operator&=(bool val) { // Version sans branching: @@ -681,7 +681,7 @@ typename NzBitset::Bit& NzBitset::Bit::opera return *this; } -template +template typename NzBitset::Bit& NzBitset::Bit::operator^=(bool val) { // Version sans branching: @@ -696,7 +696,7 @@ typename NzBitset::Bit& NzBitset::Bit::opera return *this; } -template +template typename NzBitset::Bit& NzBitset::Bit::operator-=(bool val) { // Version sans branching: