Re: [Doxygen-users] Static const Variables being documented as functions.
Brought to you by:
dimitri
From: Braden M. <br...@en...> - 2009-11-25 22:58:43
|
Simon wrote: >> I tried doing exactly as you instructed, and the generated documentation >> in the header file is correct, but the .cpp file still shows "const >> Color::Color COLOR_WHITE" as a function. Any thoughts? > > > I'm working on a geometry library and made a test with a similar line of code: > > const Vector ONE(1,1,1); > > In the header file, if you place just that line (which is btw, both a > declaration and a definition) doxygen interprets it as a function. > > Changing the line in the header file for this one: > > extern const Vector ONE; > > And adding the original line in a code file: > > const Vector ONE(1,1,1); > > Now it gets interpreted by doxygen as a variable. Further, some > testing shows it might just be the presence of the parenthesis in the > declaration that confuse doxygen... in any case, it's bad practice to > have such definitions in header files. No, it's not. namespace-scope consts have internal linkage in C++ (unless you specify otherwise); so there's no problem with this. -- Braden McDaniel e-mail: <br...@en...> <http://endoframe.com> Jabber: <br...@ja...> |