News for hackers. Stuff that matters.
Re:Popular Myths about C++, Part 1 by jerf on Tuesday December 09, 2014 @10:57AM (#8723428)
Go would do:

    v := []TYPEHERE{1, 2, 3}
where TYPEHERE is the type of array[1] that you're creating. Is there any equivalent C++ technique here? Explaining all the machinery may blow out a novice's mind, but I think explaining "You need to give C++ some clue about the type" isn't so bad.

[1]: Before you complain I just created a slice, remember the slice has to point at an array; I've created both a slice and an array so it's not "wrong" to say I've created an array with that syntax.

Re:Popular Myths about C++, Part 1 by TheCoelacanth on Tuesday December 09, 2014 @11:25AM (#8723627)
Yes, C++ has no shortage of ways to initialize variables. Any of these should work

    TYPENAME v {1, 2, 3};
    TYPENAME v = {1, 2, 3};
    auto v = TYPENAME {1, 2, 3};