You can already do it manually if you use HTML.
Changed one of my answers here to bold cout
, wherever it occurs:
Just specialize that one function:
template <typename template_type> class awesome_class{
public:
void some_function(void){
cout << "I am not of type_a and doing my normal methods";
}
};
template<> void awesome_class<type_a>::some_function(void){
cout << "I am of type_a and doing type_a specific methods";
}
Of course, if things are more complicated, you might have to use
inheritance and SFINAE.
Just specialize that one function:
<!-- language: lang-cpp -->
<pre><code>template <typename template_type> class awesome_class{
public:
void some_function(void){
<b>cout</b> << "I am not of type_a and doing my normal methods";
}
};
template<> void awesome_class<type_a>::some_function(void){
<b>cout</b> << "I am of type_a and doing type_a specific methods";
}</code></pre>
Of course, if things are more complicated, you might have to use
inheritance and SFINAE.
Anyway, most of the time reducing the code and using the languages standard code-comments where needed is a better idea.