Looking for an easy way to reinitialize a struct
问题 I have a struct called CoolStruct: struct CoolStruct { int id; uint32 type; uint32 subtype; String name; }; I have a vector of these structs as well: std::vector<CoolStruct> coolVector; I want to create a bunch of structs which have predefined values to push_back into this coolVector. I'd like to keep the code from getting cludgy and ugly. I would really like to keep this notation: CoolStruct t = {1, EQData::EQ_EFFECT_TYPE_PARAMETRIC, 0, T("Parametric")}; coolVector.push_back(t); CoolStruct t