Hello, I'm new to C++ and I have a question...
I tried answering the question myself by making a test application... in debug, the class B initialization generates less assembly code, but in release mode, I can't really say... it optimizes the initializations away :(
Let's say I have two classes:
class A
{
public:
int a, b, c, d;
A(int _a, int _b, int _c, int _d) : a(_a), b(_b), c(_c), d(_d)
{
}
};
class B
{
public:
int a, b, c, d;
};
Is there any advantage of using
B b = {1, 2, 3, 4}
instead of
A a = A(1, 2, 3, 4);
?