Core/Bitset: Replace static members by static constexpr

Former-commit-id: 0c2a2eb8d766f544016068cdc4be859be2b20dd5
This commit is contained in:
Lynix 2016-01-08 01:28:49 +01:00
parent b9ec4a4fc4
commit bbaa328530
2 changed files with 4 additions and 12 deletions

View File

@ -9,6 +9,7 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/String.hpp>
#include <limits>
#include <memory>
#include <type_traits>
@ -89,9 +90,9 @@ namespace Nz
Bitset& operator|=(const Bitset& bitset);
Bitset& operator^=(const Bitset& bitset);
static Block fullBitMask;
static unsigned int bitsPerBlock;
static unsigned int npos;
static constexpr Block fullBitMask = std::numeric_limits<Block>::max();
static constexpr unsigned int bitsPerBlock = std::numeric_limits<Block>::digits;
static constexpr unsigned int npos = std::numeric_limits<unsigned int>::max();
private:
unsigned int FindFirstFrom(unsigned int blockIndex) const;

View File

@ -521,15 +521,6 @@ namespace Nz
return bit / bitsPerBlock;
}
template<typename Block, class Allocator>
Block Bitset<Block, Allocator>::fullBitMask = std::numeric_limits<Block>::max();
template<typename Block, class Allocator>
unsigned int Bitset<Block, Allocator>::bitsPerBlock = std::numeric_limits<Block>::digits;
template<typename Block, class Allocator>
unsigned int Bitset<Block, Allocator>::npos = std::numeric_limits<unsigned int>::max();
template<typename Block, class Allocator>
typename Bitset<Block, Allocator>::Bit& Bitset<Block, Allocator>::Bit::Flip()