As a follow-up question to 'Do parentheses after the type name make a difference':
If 'Test' is an ordinary class, is there any difference between:
Test* test = new Test();
// and
Test* test = new Test{};
Furthermore, suppose Test2 has a constructor for an argument of type Value, is it always equivalent to write:
Value v;
Test2 *test2 = new Test(v);
// and
Test2 *test2 = new Test{v};
Aucun commentaire:
Enregistrer un commentaire