I just came across some code and I believe I have never seen the syntax shown below.
struct A {
int m_int;
A (int a = int {}) : m_int(a) {}
};
So its clear that the constructor accepts an integer, by value, i.e. int a
followed by assignment operator and type int
, and empty braces & right parenthesis close. I am not able to decipher the latter part (int {}
). What is meant by int a = int {}
?. Please guide me to find out more about it. How do I address it?
Thank you, Gaurav