Why can't I declare a method that returns a vector?

This is a discussion on Why can't I declare a method that returns a vector? within the C++ Programming forums, part of the General Programming Boards category; I get a compile error with this: Code: //Throws: "expected constructor, destructor or type conversion before '<' token" std::vector<int> someMethod() ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    184

    Why can't I declare a method that returns a vector?

    I get a compile error with this:

    Code:
    //Throws: "expected constructor, destructor or type conversion before '<' token"
    std::vector<int> someMethod()
    {
    ...
    }

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    184
    Never mind. I figured it out.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Vector of Strings help
    By CowsOFFmylawn in forum C++ Programming
    Replies: 7
    Last Post: 01-11-2009, 09:38 PM
  2. reserve method of vector
    By George2 in forum C++ Programming
    Replies: 11
    Last Post: 11-15-2007, 03:24 PM
  3. Problems defining classes
    By esmeco in forum C++ Programming
    Replies: 47
    Last Post: 10-24-2007, 02:13 PM
  4. syntax help?
    By scoobygoo in forum C++ Programming
    Replies: 1
    Last Post: 08-07-2007, 11:38 AM
  5. Operators for 3D Vector Mathematics
    By Anarchist in forum C++ Programming
    Replies: 10
    Last Post: 01-31-2003, 07:33 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21