C++11 feature – Struct initialisation on heap

This is accepted code in c++ in the new C++11 to initialize a struct on the heap.

[cc lang=”cpp”]
struct Bar {
int aa;
std::string bb;
}

Bar* bar = new Bar{23, "Hello"};
[/cc]

Notice the use of { and } instead of ( and )