Closed
Description
In Cpp1 we have the confusing fact that
#include <vector>
using namespace ::std;
int main() {
auto a = vector<int>{5, 1}; // vector of five and one
auto b = vector<int>(5, 1); // vector of five ones
}
Experimenting with (pure) Cpp2 I got a similar case
main: () -> int = {
a: std::vector<int> = (5, 1); // vector of five and one
b := std::vector<int>(5, 1); // vector of five ones
}
This becomes clear when looking at the tanspiled code
std::vector<int> a { 5, 1 }; // vector of five and one
auto b { std::vector<int>(5, 1) }; // vector of five ones
For me the Cpp2 case looks even more confusing (than the Cpp1 case), because both ctor calls use parenthesis.