|
|
|
|
|
by quietbritishjim
9 days ago
|
|
In C++ you can write "int x;" and get an object of type int. If the only way to initialise a class-type object was to call some custom static method on it then you'd have to write "Foo x = Foo::create();". Suddenly it looks more special than a built-in type. |
|
I guess the argument might be that for C++, they want the author of the type to determine whether the value should be left uninitialized on declaration/construction, instead of the caller. Which is... not exactly the semantics I would have chosen.