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. C / C++ / MFC
  4. just a small syntax question

just a small syntax question

Scheduled Pinned Locked Moved C / C++ / MFC
helpwpfgraphicsquestion
4 Posts 2 Posters 0 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.
  • Y Offline
    Y Offline
    Ylis
    wrote on last edited by
    #1

    I have a question about the syntax when it comes to templates. What I want to do is to create a pointer to a std::vector which contains pointers to a class called Square. I thought it would look like: std::vector< Square* >*, but obviously my compiler thinks not and gives me "error C2059: syntax error : '>'". Any help appriacted :)

    J 1 Reply Last reply
    0
    • Y Ylis

      I have a question about the syntax when it comes to templates. What I want to do is to create a pointer to a std::vector which contains pointers to a class called Square. I thought it would look like: std::vector< Square* >*, but obviously my compiler thinks not and gives me "error C2059: syntax error : '>'". Any help appriacted :)

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      That is correct syntax. Are you using VC6 and have you #include <vector>? VC6's a bit a wacko when it comes to templates. Try this and see what happens:

      typedef Square* SquarePtr;
      std::vector<SquarePtr>* pVector;

      -- Gott weiß ich will kein Engel sein.

      Y 1 Reply Last reply
      0
      • J Jorgen Sigvardsson

        That is correct syntax. Are you using VC6 and have you #include <vector>? VC6's a bit a wacko when it comes to templates. Try this and see what happens:

        typedef Square* SquarePtr;
        std::vector<SquarePtr>* pVector;

        -- Gott weiß ich will kein Engel sein.

        Y Offline
        Y Offline
        Ylis
        wrote on last edited by
        #3

        I use VS.net 2003 and have vector included. What you suggested seems to work though, thx a lot :)

        J 1 Reply Last reply
        0
        • Y Ylis

          I use VS.net 2003 and have vector included. What you suggested seems to work though, thx a lot :)

          J Offline
          J Offline
          Jorgen Sigvardsson
          wrote on last edited by
          #4

          :confused: That's odd! I haven't seen any weirdness like that from vs.net 2003. -- Gott weiß ich will kein Engel sein.

          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