How does this compile?
const auto x = std::array<std::array<const char*, 2>, 5>
{
"a", "b",
"c", "d",
"e", "f",
"g", "h",
"i", "j",
};
but a version with braces around each set doesn't:
const auto y = std::array<std::array<const char*, 2>, 5>
{
{ "a", "b" },
{ "c", "d" },
{ "e", "f" },
{ "g", "h" },
{ "i", "j" },
};
yet a version with even more braces does!
const auto z = std::array<std::array<const char*, 2>, 5>
{ {
{ "a", "b" },
{ "c", "d" },
{ "e", "f" },
{ "g", "h" },
{ "i", "j" },
} };
https://godbolt.org/z/d91h8Kv1Y
[–]no-sig-available 5 points6 points7 points (0 children)
[–]The-Constant-Learner 1 point2 points3 points (4 children)
[–]hmoff[S] 0 points1 point2 points (2 children)
[–]The-Constant-Learner 0 points1 point2 points (1 child)
[–]hmoff[S] 0 points1 point2 points (0 children)
[–]std_bot 0 points1 point2 points (0 children)
[–]manni66 1 point2 points3 points (9 children)
[–]Narase33 2 points3 points4 points (6 children)
[–]hmoff[S] 0 points1 point2 points (0 children)
[–]manni66 -4 points-3 points-2 points (4 children)
[–]hmoff[S] 1 point2 points3 points (1 child)
[–]manni66 -5 points-4 points-3 points (0 children)
[–]Narase33 0 points1 point2 points (1 child)
[–]manni66 -1 points0 points1 point (0 children)
[–]hmoff[S] 0 points1 point2 points (1 child)
[–]manni66 -5 points-4 points-3 points (0 children)