What is the C++ way to calculate some values using template params?
template<typename T, size_t SIZE>
class ThreadSafeArray
{
private:
static const size_t BLOCK_SIZE = SIZE > 32 ? 16 : 4;
static const size_t MUTEX_COUNT = SIZE / BLOCK_SIZE + 1;
...
};
or this
template<typename T, size_t SIZE>
class ThreadSafeArray
{
private:
enum
{
BLOCK_SIZE = SIZE > 32 ? 16 : 4,
MUTEX_COUNT = SIZE / BLOCK_SIZE + 1
};
....
};
or somehow else?