04 函数注释和注意事项

函数注释和注意事项

  • @see:指向另一个参考实体
  • @return:描述返回值信息
  • @param:描述某个参数的信息

  • @note:一些说明

  • @attention:注意点

  • @warning:警告说明

  • @details:详细描述

class MyClass
{
public:
/// store the name of class
string name;

/// store the num of class
///
/// @see num_of_class()
int numbers;

/// get the number of class
/// @return the number of class objects
int num_of_class();

/// Create a MyClass object with default values
MyClass();

/// Create a MyClass object with given values
///
/// @details input a name
/// @param name The name of the object
/// @note A object should have a name
/// @attention name should not be empty
/// @warning no name will crack!
MyClass(string _name);
}