SFML community forums

Help => Network => Topic started by: bloodust on March 23, 2011, 09:49:35 am

Title: SFML 2 TcpSocket::Send parameter not const
Post by: bloodust on March 23, 2011, 09:49:35 am
Why is the parameter not const in this function ?
Code: [Select]
Socket::Status TcpSocket::Send(Packet& packet)
Why is this member function not const? It does not modify the object and it returns const data.
Code: [Select]
const char* Packet::OnSend(std::size_t& size)
Title: SFML 2 TcpSocket::Send parameter not const
Post by: Laurent on March 23, 2011, 10:03:56 am
It's not const so that derived Packet classes can implement in-place modifications, rather than being forced to copy their data on every call to Send().