GNOME Bugzilla – Bug 619790
Linking to template specializations inside a @link structural command fails
Last modified: 2013-05-19 12:35:54 UTC
Created attachment 162079 [details] Little code that demonstrates the described bug The attached sourcefile shows the situation. There is some template, which is by default not implemented. Only some specializations are relevant for the code and should be allowed to be instantiated. In the documentation I try to create a link to either one of this specializations (an int-version here) without having the full name of that specialization appear in the documentation. When creating a link to that specialization by the automatic linking process, it works. When trying inside a @link - @endlink block it fails.
It seems doxygen has many issues dealing with template specializations. I have never been able to get links (automatic or otherwise) to work against template specializations.
Hi Matthew, Thanks for your feedback, but can you attach examples demonstrating the many issues you found? That would help me in fixing them.
For me, I have never been able to get template specializations to work in any part of a comment that uses auto-linking or explicit linking, as Jakob did. An example would be if I defined a signal class and a set of specializations such as: /** @brief The signal class allows many functions to be attached ... Only a limited number of specializations exist for @p Signature, they are: @li @ref signal<void(void)> @li @ref signal<void(Arg0&)> @li @ref signal<void(Arg0&,Arg1&)> */ template <typename Signature> class signal { ... }; template <> class signal<void(void)> { ... }; template <typename Arg0> class signal<void(Arg0&)> { ... }; template <typename Arg0, typename Arg1> class signal<void(Arg0&,Arg1&)> { ... }; To make a link to any specialization, I have resourced to using the <a> tag like so: @li <a href="classsignal_3_01void_07void_08_4.html" ><b>signal\<void(void)\></b></a> @li <a href="classsignal_3_01void_07_arg0_01_6_08_4.html" ><b>signal\<void(Arg0&)\></b></a> ...
I likewise can't get this to work (at all), using Doxygen 1.8.3: /// Documentation here. This works. template <typename T> struct default_delete { ... } /// Documentation here. This also works; shows up as a separate class. template <typename T> struct default_delete<T[]> { ... } /// More documentation. /// A link to default_delete works as expected. /// It links to the generic variant. /// A link to default_delete<T[]> does not work as desired. /// It also links to the generic variant, not the specialization. void foo(); ...I've also tried e.g. escaping the <>'s, using </> instead, using \ref, using \link... nothing I've tried generates a link to the specialization. (I did however check the tag file, and there IS a tag for the specialization. I would guess that the way doxygen parses the text, it stops gathering charaters for the tag when it gets to the '<' (in whatever form), and so always finds the generic variant and not the specialization.)
Problems should be fixed with David's patch posted here: http://doxygen.10944.n7.nabble.com/PATCH-Improved-support-for-linking-to-template-specializations-td5806.html I'll include this patch in the next subversion update.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.8.4. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.