forked from zhmzhen/candcppCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcppFunc.cpp
More file actions
33 lines (29 loc) · 709 Bytes
/
cppFunc.cpp
File metadata and controls
33 lines (29 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <string>
class CFX {
public:
void display(void) {
std::cout << "\t\tFunction name: <" << __func__ << ">" << std::endl;
}
};
[[nodiscard("Have to handle the return value")]] int ignoreReturnV() {
//int ignoreReturnV() {
return 42;
}
//void maybeUnused(int para1) {
void maybeUnused([[maybe_unused]] int para1) {
}
void FunAtt() {
std::cout << "\tFunAtt: enter" << std::endl;
maybeUnused(12);
//ignore return value
//ignoreReturnV();
std::cout << "\tFunAtt: " << ignoreReturnV() << std::endl;
std::cout << "\tFunAtt: exit" << std::endl;
}
int main() {
std::cout << "main: enter" << std::endl;
FunAtt();
std::cout << "main: exit" << std::endl;
return 0;
}