C++ how to use emplace_back for user defined structure
1 I am trying to make use of emplace_back for my user defined structure: #include <cstdint> #include <vector> #include <string> struct IDNumber IDNumber(std::vector<int> d) : id(d) std::vector<int> id; ; struct Def Def(std::initializer_list<int> id) : mid(id) IDNumber mid; ; struct Student std::vector<Def> ent; ; int main() Student a; a.ent.emplace_back( 2000 ); I get compilation issues: error: no matching function for call to 'std::vector<EntryDef>::emplace_back' c++ c++11 share | improve this question edited Nov 15 '18 at 0:48 Programmer asked Nov 14 '18 at 14:35 Programmer Programmer 2,953 18 51 103 5 Your first argument to your constructor is std::initializer_list<int> yet you pass 2, 1 ? – CoryKramer Nov 14 '18 at 14:38 I tried to change the line - a.ent.emplace_back(2,1,2, FType::FD_NONE, Fmt::FMT_NONE, RWPr...