lundi 29 mai 2017

std::vector

I am using a class called Signal in my Qt project. In another class definition I want to have a private member of the type std::vector<Signal>.

class Message {
public:
    std::vector<Signal> signals;
...

The Signal class only holds basic type members (int, float) and implements getters and setters. Also it has some operator overloads for +, -, = and >> via friend function.

I am compiling with the Visual C++ Compiler 12.0 and the project compiles completely without the definition of the vector. However with it, it throws this error:

std::vector<Class, std::allocator<_Ty>>: no members defined using this type with _Ty=Signal

I have included both header files, <vector> and "signal.hpp".

Also the simplest vector<int> throws exactly the same error (ofc with int where Signal was written before)...

It is compiling with Visual Studio 2017 and g++ on ArchLinux, so maybe is this a C++11 Problem I am not aware of?

Aucun commentaire:

Enregistrer un commentaire