c++ - Hiding template implementation details from Doxygen -


one of (so many) unfortunate design flaws of c++ is impossible separate implementation interface when using template metaprogramming.

all on library have things like:

template <typename ma, typename mb> typename boost::enable_if_c<             detail::ismatrix<ma>::val , detail::ismatrix<mb>::val ,             detail::matrixdimensioncheck<ma,mb>::isstaticmatch,          bool>::type operator==(const ma &a, const mb &b) {     return detail::matrixequal(a,b); } 

if unreadable, don't blame you. of mess defining return type bool if arguments matrices , match dimension, , undefined if else (thus relying on sfinae prevent operator hiding other important things).

since guts of static type-checking function embedded signature of ordinary c++ function, these implementation guts appear in generated documentation.

i don't want user have read this. need know function returns bool (which impossible tell reading above). in docs, can explain succinctly, in plain english, operator accepts matrices.

is there way persuade doxygen render type mess bool? (i'm assuming there more or less no way clean in code directly, ideas welcome if can think of something).

well, way may achieve duplicating function definition rather using automatic feature of doxygen, , using @fn command instead. example, like

/*!@fn template <typename ma, typename mb> bool operator==(const ma &a, const mb &b)  * @brief equality operator  * @note operator available if types @c ma , @c mb match.   *       discarded otherwise   */  template <typename ma, typename mb>    typename boost::enable_if_c<      detail::ismatrix<ma>::val , detail::ismatrix<mb>::val ,      detail::matrixdimensioncheck<ma,mb>::isstaticmatch,     bool>::type  operator==(const ma &a, const mb &b) {     return detail::matrixequal(a,b);  } 

should do.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -