Common: Move BitSet helper functions into the Common namespace

This commit is contained in:
Lioncash
2018-04-22 23:45:02 -04:00
parent 2ce0f42c14
commit d68f437e67
2 changed files with 9 additions and 9 deletions

View File

@ -7,12 +7,12 @@
#include <type_traits>
#include "CommonTypes.h"
// Helper functions:
#ifdef _WIN32
#include <intrin.h>
namespace Common
{
template <typename T>
constexpr int CountSetBits(T v)
{
@ -49,6 +49,8 @@ inline int LeastSignificantSetBit(u64 val)
return (int)index;
}
#else
namespace Common
{
constexpr int CountSetBits(u8 val)
{
return __builtin_popcount(val);
@ -83,8 +85,6 @@ inline int LeastSignificantSetBit(u64 val)
}
#endif
namespace Common
{
// Similar to std::bitset, this is a class which encapsulates a bitset, i.e.
// using the set bits of an integer to represent a set of integers. Like that
// class, it acts like an array of bools: