I'm using Doxygen to document some of my code. I've got a function that uses a default argument, which is specified in the header i.e.:
unsigned int CountColumns(const std::string&,const std::string& delim="");
and the corresponding implementation in the source file as:
unsigned int CountColumns(const string& input,const string& delim)
{
...
}
When I use Doxygen to generate my documentation, CountColumns has two entries - one including the default value, and one without:
unsigned int CountColumns (const string &input, const string &delim)
unsigned int CountColumns (const std::string &, const std::string &delim="")
How can this be avoided? I don't want multiple function definitions cluttering up my documentation.
EDIT: As I've also mentioned in my answer below, the problem appears to be due to the fact that the header file uses 'std::string' in the arguments, while the source file includes a 'using std::string' statement and then uses 'string' in the arguments. If I alter the function definition to use 'std::string' in the source file also, Doxygen recognises it to be the same function as declared in the header.
I suggest to set BUILTIN_STL_SUPPORT
to YES
in your configuration file, so doxygen knows string is a class defined in the std namespace.
The problem appears to be due to the fact that the header file uses 'std::string' in the arguments, while the source file includes a 'using std::string' statement and then uses 'string' in the arguments. If I alter the function definition to use 'std::string' in the source file also, Doxygen recognises it to be the same function as declared in the header.
While not ideal, it is a solution that works and is not too unwieldy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With