Hi guys!
I'm trying to build a Chat application with Qt and TCP. I've attached the server-side project as an attachment.
Each new client is created as an object on ClientSocket-class.
Each client should be able to write messages to other clients, of course, so I was thinking of creating a static vector where to store all the chatters. However as you see if you try to build my project enumerating the objects from the vector doesn't work. I've tried to do it according to this example:
http://www.cplusplus.com/reference/stl/vector/begin/
QtCreator outputs following error while build:
|
Source code
|
1
2
|
clientsocket.cpp:54: error: no match for 'operator=' in 'i = ClientSocket::_usrList.std::vector<_Tp, _Alloc>::begin [with _Tp = ClientSocket, _Alloc = std::allocator<ClientSocket>]()'
clientsocket.cpp:54: error: no match for 'operator<' in 'i < ClientSocket::_usrList.std::vector<_Tp, _Alloc>::end [with _Tp = ClientSocket, _Alloc = std::allocator<ClientSocket>]()'
|
What am I doing wrong?
Thanks already!
-Membit