Possible Duplicate:
how-to initialize 'const std::vector<T>' like a c array
What's the proper syntax to provide an explicit initializer for a std::vector when it's a member of a structure? Here's the structure:
struct pattern_info
{
std::string pattern;
std::vector<std::string> patterns;
};
Here's how I would like to initialize it (the ??? is the part I'm not sure about):
pattern_info p = { "", ??? };
I know that {} will provide a reasonable default for all the structure members, but I prefer not to do that.
When I compile with -std=c++0x I can do this (and it seems to work):
pattern_info p = { "", {} };
I'm using gcc version 4.4.5 (Debian 4.4.5-8) and would like to do this without the -std=c++0x option.