As you, the reader, may or may not be aware, I’m currently writing a Textual User Interface engine called Pango Engine to be used for the future roguelike games I make. It’s a bit like the old Borland Turbo thing, with characters making up the graphics of the user interface.

todo: get image to show properly inline

Well basically I came across a problem when using Visual Studio 2012 today. I wanted to initialize a vector of strings with a literal,  {“like”,”this”,”baby”}. This is in fact possible in c++11 via the holy and mystical power of initializer lists, but Microsoft have only got part of the way to supporting this feature yet. In fact you need to have the Community Technology Preview from November to get any support at all. This support is limited to your own classes. There is no support for the standard library yet, so no vectors of strings for me.

I got really annoyed about it for a bit, and I had a sore back anyway from too much sitting at the computer. When I came back later I was more calm, and just declared an array of strings on the line before, like

std::string stations[]={“Rock”,”Pop”,”Classical”};

then used that as a parameter in my function call (and rewrote the function to accept it).

Advertisements