Hi Harald,

> On 26 Aug 2015, at 15:19 , Heese, Harald <harald.he...@philips.com> wrote:
> 
> Hi doxygen,
> 
> I am encountering warnings using Doxygen 1.8.10 for the below example of 
> overloaded template member functions with explicit instantiation of one (or 
> more) of the overloads for specific template types.
> 
> //! a test class with overloaded template members
> class Bar
> {
> public:
>  //! first overload of template member function
>  template <typename T>
>  T foo(T a, int b);
> 
>  //! second overload of template member function
>  template <typename T>
>  T foo(T a, double c);
> };
> 
> //! force instantiation of first overload for type 'short'
> template short Bar::foo<short>(short, int);
> 
> Output
> 
> warning: no matching class member found for
>  template short Bar::foo< short >(short, int)
> Possible candidates:
>  'template < T >
>  T Bar::foo(T a, int b)
>  'template < T >
>  T Bar::foo(T a, double c)
> 
> Is there a way to incorporate the existence of an explicit instantiation (or 
> its accompanying doxygen documentation) in the detailed documentation of the 
> class member (which happens if there are no overloads)?

If you use

//! force instantiation of first overload for type 'short'
template<> short Bar::foo<short>(short, int);

it should work. Note the <> after template. My compiler doesn't even compile 
the code without it.

Groeten,
  Dimitri


------------------------------------------------------------------------------
_______________________________________________
Doxygen-users mailing list
Doxygen-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/doxygen-users

Reply via email to