mort<p>Uh. Why does initializing a C++ 'std::array' with an initializer list work differently from initializing a 'std::vector' or a C array with an initializer list?</p><p>For the std::array, the compiler complains that it can't initialize a pair from an int, as if it treats '{1, 2}' as its own array. It works with an extra pair of braces that's not necessary for std::vector and C arrays.</p><p>What dark corner of C++ initialization rules have I missed </p><p><a href="https://godbolt.org/z/96TW43jqW" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">godbolt.org/z/96TW43jqW</span><span class="invisible"></span></a></p><p><a href="https://floss.social/tags/cplusplus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cplusplus</span></a> <a href="https://floss.social/tags/cpp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cpp</span></a> <a href="https://floss.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>