You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#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.
JohelEGP, MichaelCook, robertshepherdcpp, HALL9kv0, jcanizales and 2 more