Template specialisation of a static function is shown in Doxygen-genered documentation

十年热恋 提交于 2019-12-12 17:07:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!