Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Deque's question

Deque's question

Scheduled Pinned Locked Moved ATL / WTL / STL
questionhelp
7 Posts 4 Posters 18 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    smartnose
    wrote on last edited by
    #1

    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?

    P E C 3 Replies Last reply
    0
    • S smartnose

      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?

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      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!

      S 1 Reply Last reply
      0
      • S smartnose

        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?

        E Offline
        E Offline
        Emilio Guijarro
        wrote on last edited by
        #3

        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"

        P 1 Reply Last reply
        0
        • E Emilio Guijarro

          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"

          P Offline
          P Offline
          Paul M Watt
          wrote on last edited by
          #4

          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!

          E 1 Reply Last reply
          0
          • S smartnose

            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?

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • P Paul M Watt

              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!

              S Offline
              S Offline
              smartnose
              wrote on last edited by
              #6

              yeeeeeeep. It works! Thank u guys! Thank u very much.

              1 Reply Last reply
              0
              • P Paul M Watt

                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!

                E Offline
                E Offline
                Emilio Guijarro
                wrote on last edited by
                #7

                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"

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups