About Store Forum Documentation Contact



Post Reply 
[solved] std::vector problems
Author Message
Azriel Offline
Member

Post: #1
[solved] std::vector problems
Hi smile I have some problems with std::vector. Compiler throws errors when I'm trying to make a function in a class with std::vector as a parameter.

Code:
class A
{
   void foo(std::vector<int> &vect) {}
   // void foo2();
   void foo2(std::vector<int> &);
};

void A::foo2(std::vector<int> &vect) {}
1. foo works fine.
2. foo2 gives errors. " illegal use of 'void' " on foo2 declaration and " 'A::foo2' : not a function " on definition.
3. If we uncomment void foo2(); everything works. We can then even define void A::foo2() {} and all of the functions work fine.

Is it me doing something wrong or is there a bug?
(This post was last modified: 11-19-2015 09:33 AM by Azriel.)
11-18-2015 10:49 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: std::vector problems
Hi, if foo works, then please use it.
However I recommend using EE containers for full compatibility, std::vector<TYPE> -> Memc<TYPE>
11-18-2015 10:39 PM
Find all posts by this user Quote this message in a reply
Post Reply