尝试 push_back 新的自定义对象时出现以下错误:
prog7.cpp:66: error: no matching function for call to
‘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>]
相关代码在这里:
deque<Job> jobs;
jobs.push_back(new Job());
我在这里做错了吗?