问题
In a C++ header of my project, I am using few static template functions helpers which are called in the non-static public functions.
When I run Doxygen on this file, each static function is hidden even when using templates, which is the correct behavior since static functions will not be visible for the outter-world. But when I do a template specialization on one of these, this specialization will appear in generated documentation :
// This will not appear in documentation, ok
template<class T>
static T my_function(...)
// However this will appear ! :(
template<>
SomeClass my_function(...)
If think this is because Doxygen is not smart enough to see that this specialization is for a static function and so this specialization appears like a regular one. But maybe I am wrong.
What can I do in order to hide this from my documentation?
回答1:
It is always possible to hide sections of code from Doxygen using @cond
and @endcond
around the code.
It's the doxygen equivalent of #if 0
/ #endif
来源:https://stackoverflow.com/questions/20979469/template-specialisation-of-a-static-function-is-shown-in-doxygen-genered-documen