Deque's question
-
-
This is my program: #include "deque" class CMsg { int MsgID; } main() { deque que; CMsg * pMsg=new(CMsg); que.pushfront(pMsg); } and I compile it with gcc. The error is:deque::pushfront(CMsg *&) no matching function. So can anybody tell me why?
try using
push_front
instead.
Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life! -
This is my program: #include "deque" class CMsg { int MsgID; } main() { deque que; CMsg * pMsg=new(CMsg); que.pushfront(pMsg); } and I compile it with gcc. The error is:deque::pushfront(CMsg *&) no matching function. So can anybody tell me why?
I think the problem is that you don´t specify what element type will be stored in the deque, you must fix the declaration: deque que; specifying the deque element type: deque que; Don´t forget that STL stands for Standard Template Library! :), so "deque" is a class template, not a simple class. "nobody knows it, but you´ve got a secret smile, and you use it only for me"
-
I think the problem is that you don´t specify what element type will be stored in the deque, you must fix the declaration: deque que; specifying the deque element type: deque que; Don´t forget that STL stands for Standard Template Library! :), so "deque" is a class template, not a simple class. "nobody knows it, but you´ve got a secret smile, and you use it only for me"
he actually does have the type declared, the HTML viewer simply chewed up the angle brackets, here is what he had: deque<CMsg*> que;
Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life! -
This is my program: #include "deque" class CMsg { int MsgID; } main() { deque que; CMsg * pMsg=new(CMsg); que.pushfront(pMsg); } and I compile it with gcc. The error is:deque::pushfront(CMsg *&) no matching function. So can anybody tell me why?
You should use <>to include stuff that is from the std library, or anything else coming from your include paths and not your own project. That is not causing your problem, but it's what you should do in general. Christian We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum ) Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
-
try using
push_front
instead.
Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life! -
he actually does have the type declared, the HTML viewer simply chewed up the angle brackets, here is what he had: deque<CMsg*> que;
Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!Thanks, I forgot the HTML nature of this message board... "nobody knows it, but you´ve got a secret smile, and you use it only for me"