Special attention should be paid when initializing class members: it is easy to get it wrong and initialize them with references that are going to
be invalidated at the end of the constructor, known as dangling references.
Noncompliant code example
struct S {
int *x;
int &y;
S(int i, int j) :
x(&i), // Noncompliant, initializing x to the stack address of i
y(j) // Noncompliant, y is bound to variable j which has a shorter lifetime
{}
};
Compliant solution
struct S {
int *x;
int &y;
S(int *i, int &j) : x(i), y(j) {}
};