Q:

Is there a convenient way to initialize simple structs in C++?

Let's say I have a simple struct like this:
struct Simple
{
    int weight;
    std::string name;
    float power;
};

I'd like to be able to initialize one of these without creating a constructor for it and without having to individually set its parameters. I dream of a syntax like this, for example:
Simple s( 4, "bill", 3.1f );

...or perhaps...
Simple s = { 4, "bill", 3.1f };

...or verily...
Simple s{ 4, "bill", 3.1f };

I know that I can get the first example to work by adding a braindead constructor of my own. Tedious.
Likewise, the last example will work in C++11, but I believe I have to provide the constructor.
Is there a way to simply and elegantly initialize a struct in C++ without having to provide a constructor?

A:

Simple s = { 4, "bill", 3.1f };

Simple s{ 4, "bill", 3.1f };

These are valid.
This syntax will map each value in the above groups/sets to each struct member variable depending on the order and you don't even need to define a constructor.

