Talk:cpp/utility/initializer list/initializer list
From cppreference.com
< Talk:cpp | utility | initializer list
I cannot formulate in words why, but I feel like you shouldn't be able to single-step implicitly create a std::initializer_list<char> from an int without casting.
Run this code
#include <utility> struct test { test(std::initializer_list<char> a) { throw a; } }; int main() { int a = 9999; auto b = test{a}; }
Output:
Program returned: 139 Program stderr terminate called after throwing an instance of 'std::initializer_list<char>'
185.56.101.104 14:18, 11 January 2021 (PST)