#include <iostream>
#include <string>
int main(int argc, char *argv[])
{
std::string s = {123};
std::cout << s << std::endl;
}
Why does this program print { as an output? Is it a bug in the underlying lexer that it only prints the preceeding {?
I compiled this with g++ 4.8.1 (with no errors or warnings). MSVC doesn't compile this complaining that string isn't an aggregate type.