cpptests/cdstr.res
raw| 1 | // https://en.cppreference.com/w/cpp/language/constructor |
| 2 | |
| 3 | class X |
| 4 | { |
| 5 | int aa, b, i, j; |
| 6 | public: |
| 7 | const int& r; |
| 8 | X(int i) |
| 9 | : r(aa) // initializes X::r to refer to X::a |
| 10 | , b{i} // initializes X::b to the value of the parameter i |
| 11 | , i(i) // initializes X::i to the value of the parameter i |
| 12 | , j(this->i) // initializes X::j to the value of X::i |
| 13 | {} |
| 14 | }; |