I have a simple recursive template that implements (the optimised version of) Euclid's algorithm. Doxygen complains about it:
/usr/home/kamikaze/stark/Yggdrasil/src/units/Units.hpp:335: warning: Detected potential recursive class relation between class units::euclid and base class units::euclid< Rhs, Lhs%Rhs >!
/usr/home/kamikaze/stark/Yggdrasil/src/units/Units.hpp:335: warning: Detected potential recursive class relation between class units::euclid and base class euclid< Rhs, Lhs%Rhs >!
/usr/home/kamikaze/stark/Yggdrasil/src/units/Units.hpp:335: warning: Detected potential recursive class relation between class units::euclid and base class units::euclid< Rhs, Lhs%Rhs >!
/usr/home/kamikaze/stark/Yggdrasil/src/units/Units.hpp:335: warning: Detected potential recursive class relation between class units::euclid and base class euclid< Rhs, Lhs%Rhs >!
I'm dumbfounded why that is a complaint/warning. I think recursive types are common and legal. It's also one of many recursive templates, but the only one doxygen complains about. To my surprise I've only found similar questions where doxygen was misdetecting recursion.
If you're interested, here is the code:
/**
* Implements Euclid's algorithm to find the GCD between two integers.
*
* @tparam Lhs,Rhs
* The values to get the GCD for
*/
template <int Lhs, int Rhs>
struct euclid : euclid<Rhs, Lhs % Rhs> {
};
/**
* Terminates Euclid's algorithm.
*
* @tparam Gcd
* The GCD to return
* @see euclid
*/
template <int Gcd>
struct euclid<Gcd, 0> {
/**
* The GCD of the two original values.
*/
static constexpr int const value{Gcd};
};