简体   繁体   中英

What does “\p” in comments means?

During reading LLVM source code, I find something different in comments, eg

/// If \p DebugLogging is true, we'll log our progress to llvm::dbgs().

What does \p means here?

LLVM uses Doxygen for generating documentation, the /// marker is one of the many ways of creating a special comment block that Doxygen will parse to form documentation.

Within a special comment block, \p is simply one of the mark-up commands , this particular one renders the following word in typewriter font (fixed rather than proportional). The \c option is an alias for the same thing.

3 slashes is one of the ways that doxygen comments are identified. The \p tag has some meaning, see it's documentation: https://www.doxygen.nl/manual/commands.html#cmdp

Displays the parameter using a typewriter font. You can use this command to refer to member function parameters in the running text.

I agree. These seems to be Doxygen commands to format typewritten fonts but since its in comments its not showing the 'font format' but the character itself.

Comments are not touched or processed by Doxygen. They have their own formatting. The /c /p precedes some important keywords (methods, members, parameters etc) only and not arbitrary. The author in all good intentions wanted people to identify the keywords but in comments, all are equal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM