#include <iostream>
int main( ) {
for ( auto e : { 1 , 2 , 3 , 4 } ) {
std:: cout << e << " " ;
}
std:: cout << std:: endl ;
for ( auto e : { 1.0 , 2.0 , 3.0 , 4.0 } ) {
std:: cout << e << " " ;
}
std:: cout << std:: endl ;
for ( auto e : { 1 , 2 , 3.0 , 4 } ) {
std:: cout << e << " " ;
}
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKSB7Cglmb3IgKGF1dG8gZSA6IHsxLCAyLCAzLCA0fSkgewoJCXN0ZDo6Y291dCA8PCBlIDw8ICIgIjsKCX0KCQoJc3RkOjpjb3V0IDw8IHN0ZDo6ZW5kbDsKCglmb3IgKGF1dG8gZSA6IHsxLjAsIDIuMCwgMy4wLCA0LjB9KSB7CgkJc3RkOjpjb3V0IDw8IGUgPDwgIiAiOwoJfQoKCXN0ZDo6Y291dCA8PCBzdGQ6OmVuZGw7CgoJZm9yIChhdXRvIGUgOiB7MSwgMiwgMy4wLCA0fSkgewoJCXN0ZDo6Y291dCA8PCBlIDw8ICIgIjsKCX0KCXJldHVybiAwOwp9
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16:29: error: unable to deduce ‘std::initializer_list<_Tp>&&’ from ‘{1, 2, 3.0e+0, 4}’
for (auto e : {1, 2, 3.0, 4}) {
^
stdout