I have a function like so:
template <typename T>
void modify(T& x) {
...
}
I would like to add an overload specialized for the type Foo
, like so:
void modify(Foo& x) {
...
}
However, this poses the problem that this definition will fail to compile if the type Foo
doesn't exist, but I'd like this header to still compile in that case, just with that overload (logically) omitted. After all, the Foo
overload won't be useful if the user hasn't included a definition of that type.