John Bandela
John Bandela

Reputation: 2436

Document a function in a different namespace

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();
}

Upvotes: 5

Views: 118

Answers (1)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385405

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

The using statement doesn't change this fundamental fact.

Upvotes: 1

Related Questions