Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Document a function in a different namespace

Tags:

c++

doxygen

I have a function that is implemented and documented in a namespace called implementation. I have another namespace useful where I use using to expose that function. I do not want to document the implementation namespace. I instead want to have the function documented under the useful namespace. I am looking for a simple way to do this in doxygen.

Below is a simple example I want useful_function documentation to be under namespace useful. Right now, it is under namespace implementation.

/// \file test.cpp
/// \brief This is a brief description.
///
///
/// This is a longer description

namespace implementation{

    /// This is a useful function
    void useful_function(){}
}

namespace useful{

    using implementation::useful_function;
}

/// \namespace useful
/// This is a namespace that has useful functions


int main(int argc, char** argv){
    useful::useful_function();
}
like image 761
John Bandela Avatar asked Nov 10 '22 15:11

John Bandela


1 Answers

useful_function is in namespace implementation, so that's where it shall be documented.

The using statement doesn't change this fundamental fact.

like image 189
Lightness Races in Orbit Avatar answered Nov 14 '22 21:11

Lightness Races in Orbit