A
Angus
Hello
I have a member variable: std::map<int, CAgents> m_AgentsList;
CAgents is just a really small class with some member variables. Just
really a container for agent data.
Agents log in to a server. In my login function I do this:
CAgents myagent;
myagent.m_Socket = pSocket;
myagent.m_strLogin = strLogin;
m_AgentsList[dwDevice] = myagent;
pSocket is a pointer to the client socket.
Basically I need to make a copy of the client socket. But I am
allocating a local variable to a member variable. When the function
returns myagent is no more. Will this not matter because the data is
copied to m_AgentsList? What about pSocket?
Angus
I have a member variable: std::map<int, CAgents> m_AgentsList;
CAgents is just a really small class with some member variables. Just
really a container for agent data.
Agents log in to a server. In my login function I do this:
CAgents myagent;
myagent.m_Socket = pSocket;
myagent.m_strLogin = strLogin;
m_AgentsList[dwDevice] = myagent;
pSocket is a pointer to the client socket.
Basically I need to make a copy of the client socket. But I am
allocating a local variable to a member variable. When the function
returns myagent is no more. Will this not matter because the data is
copied to m_AgentsList? What about pSocket?
Angus