Is it possible to declare a template function where a certain type is derived from let's say B?
My goal is to achieve something like this:
template<class T : std::ostream> void write(T os) {
os << "...";
}
template<class T : std::string> void write(T s) {
// ...
}
Edit: I know it is not a solid example since it is not usual to derive from a string, but note that it's just a example.
So any solution like a workaround is welcome, however I would like to be able to explicit instantiate the template functions.