I recently caught up on Member Initializer Lists.
The Cpp-Learning-Site suggests to always prefer direct list initialization over direct initilization.
int a(5);
int b{5}; // preferred
I noticed that both of these can be used in Member initializer lists.
Which one of the following is better and for which reasons?
Thank you in advance.
class Foo {
public:
int a;
Foo(int a): a(a) {}
};
class Bar {
public:
int a;
Bar(int a): a{a} {}
};