After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691602 - [C++11] Problem for associating documentation to the right function for template SFINAE
[C++11] Problem for associating documentation to the right function for templ...
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.2
Other All
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2013-01-12 13:18 UTC by Vincent
Modified: 2013-01-20 13:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vincent 2013-01-12 13:18:09 UTC
Consider the following code that uses template SFINAE thanks to std::enable_if of C++11:

-----------------------------------------------------------
#include <iostream>
#include <type_traits>
#include <string>

struct MyClass
{
    template<typename T, class = typename std::enable_if<std::is_arithmetic<T>::value>::type> 
    void f(const T& x) const;
    
    template<typename T, class = typename std::enable_if<!std::is_arithmetic<T>::value>::type, class = void> 
    void f(const T& x) const;
};

/// \brief Version 1
template<typename T, class> 
void MyClass::f(const T& x) const
{
    std::cout<<"Version 1"<<std::endl;
}

/// \brief Version 2
template<typename T, class, class> 
void MyClass::f(const T& x) const
{
    std::cout<<"Version 2"<<std::endl;
}

int main()
{
    MyClass myclass;
    myclass.f(3);
    myclass.f(std::string());
    return 0;
}
-----------------------------------------------------------

Doxygen is not able to associate the documentation to each function and produces only documentation for the first one.
Comment 1 Dimitri van Heesch 2013-01-19 22:44:33 UTC
Confirmed. Should be fixed in the next subversion update.
Comment 2 Dimitri van Heesch 2013-01-20 13:35:01 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.3.1. 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.