c++ - Deque using custom class cannot push_back -


i getting following error when attempting push_back new custom object:

prog7.cpp:66: error: no matching function call      ‘std::deque<job, std::allocator<job>     >::push_back(job*)’     /usr/include/c++/4.4/bits/stl_deque.h:1201: note: candidates      are: void std::deque<_tp, _alloc>::push_back(const _tp&)      [with _tp = job, _alloc = std::allocator<job>] 

relevant code here:

deque<job> jobs; jobs.push_back(new job()); 

am doing wrong here?

say this:

jobs.push_back(job());         // copy default-initialized object 

or:

jobs.emplace_back();           // direct-initialize new object 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -