I'm trying to introduce a check where a non-type template parameter for a class is smaller than some maximum. Currently I have the following code which compiles:
template<std::size_t Size>
requires (Size < SIZE_MAXIMUM)
class arena_allocator
{
...
I have the following concept:
template<std::size_t Size> concept allocation_size =
requires{
Size < SIZE_MAXIMUM;
};
When applying the concept as follows:
template<allocation_size Size>
class arena_allocator
{
...
I get the following error: error C7600: 'hp::mem::allocation_size': the concept designated by a type constraint shall be a type concept
Based on this I would guess that constraining non-type template parameters isn't possible using concepts, or am I missing something? If not, how would I constrain the values of a non-type template parameter?