I have a generic class with a function that I want to restrict to instances of floating point types only, at compile time. As shown in the example below:
template <typename T>
class ClassName
{
// instance variables, etc..
void some_method()
{
// do stuff, but only for floating point types
}
}
How do I make the compiler reject the usage of some_method for ClassName of non-floating point types?
I have been looking at SFINAE but I simply can't get it to work, so after several hours of failing I'm asking for your help.
Thanks :)