| ▲ | layer8 3 hours ago | |||||||
These aren’t problems with the constructors per se, though. E.g. Java doesn’t have any of these problems. | ||||||||
| ▲ | pwdisswordfishq 3 hours ago | parent [-] | |||||||
Java absolutely does have the ambiguous overload problem.
How do you construct a MyVector of two items?In JavaScript, how do you use new Array(...) to create an array consisting of a single integer? You can do the same with a single value of any other type. The reason these languages don't have the make_unique or emplace problems is because they don't have a concept of in-place construction at all, since objects in those languages are heap-allocated and have reference semantics anyway. | ||||||||
| ||||||||