Debian Codegraph @

clang-tools-extra/test/clang-doc/Inputs/basic-project/include/Calculator.h

raw
1 #pragma once
2
3 /**
4 * @brief A simple calculator class.
5 *
6 * Provides basic arithmetic operations.
7 */
8 class Calculator {
9 public:
10 /**
11 * @brief Adds two integers.
12 *
13 * @param a First integer.
14 * @param b Second integer.
15 * @return int The sum of a and b.
16 */
17 int add(int a, int b);
18
19 /**
20 * @brief Subtracts the second integer from the first.
21 *
22 * @param a First integer.
23 * @param b Second integer.
24 * @return int The result of a - b.
25 */
26 int subtract(int a, int b);
27
28 /**
29 * @brief Multiplies two integers.
30 *
31 * @param a First integer.
32 * @param b Second integer.
33 * @return int The product of a and b.
34 */
35 int multiply(int a, int b);
36
37 /**
38 * @brief Divides the first integer by the second.
39 *
40 * @param a First integer.
41 * @param b Second integer.
42 * @return double The result of a / b.
43 * @throw std::invalid_argument if b is zero.
44 */
45 double divide(int a, int b);
46 };