File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,48 @@ void case1()
2020
2121}
2222
23+ void case2 ()
24+ {
25+ using namespace std ;
26+
27+ int x = 100 ;
28+
29+ const int & rx = x;
30+ const int * px = &x;
31+
32+ cout << rx << *px << endl;
33+
34+ string name = " uncharted" ;
35+
36+ const string* ps1 = &name;
37+ // *ps1 = "spiderman";
38+
39+ cout << *ps1 << endl;
40+
41+ string* const ps2 = &name;
42+ *ps2 = " spiderman" ;
43+
44+ cout << *ps2 << endl;
45+
46+ const string* const ps3 = &name;
47+ }
48+
49+ class DemoClass final
50+ {
51+ private:
52+ using mutex_type = int ; // dummy type
53+ private:
54+ mutex_type m_mutex;
55+
56+ const long MAX_SIZE = 256 ;
57+ int m_value;
58+ public:
59+ int get_value () const
60+ {
61+ return m_value;
62+ }
63+ };
64+
2365
2466constexpr
2567int fib (int n)
@@ -36,6 +78,7 @@ int main()
3678 using namespace std ;
3779
3880 case1 ();
81+ case2 ();
3982
4083 constexpr
4184 int fib5 = fib (5 );
You can’t perform that action at this time.
0 commit comments