Search code examples
c++classcomments

What’s the purpose of an exclamation mark at the start of a block comment?


I have a header file in c++, where the declaration of the functions have block comments that start with "!" exclamation marks.

Example

class test{
 public:
        /*! @fn test::test()
            @brief The basic constructor, which initializes the _test handle.
        */
        test();

        /*! @fn test::upload(std::string url)
            @brief A function to execute a http POST request with the given url and image.

            @param[in] url The url we are POSTing to
            @return The response of the server
        */
        std::string upload(std::string url);
}

Also, it changes the color of the comment in VSCode like this:

enter image description here

What’s the purpose of the exclamation marks at the start of those comments?


Solution

  • These comments are for the Doxygen system that automatically generates documentation from code.