Is there a way to have a template specialization based on a range of values instead of just one? I know the following code is not valid C++ code but it shows what I would li
Use an extra defaulted bool
parameter:
// primary template handles false
template
class circular_buffer {
unsigned char buffer[SIZE];
unsigned int head; // index
unsigned int tail; // index
};
// specialization for true
template
class circular_buffer {
unsigned char buffer[SIZE];
unsigned char head; // index
unsigned char tail; // index
};