I was wondering if it is possible to restrict a template type to be a variable type of a specific size? Assuming I want to accept 4-bytes variable and rejects all the others, if running this code on some compiler where sizeof(int) == 4 and sizeof(bool) == 1:
template <class T> FourOnly {...};
FourOnly<int> myInt; // this should compile
FourOnly<bool> myBool; // this should fail at compilation time
Any idea? Thanks!