class sock {
public:
SOCKET m_hSock;
.....
//Other functons...contructors, destructors
.....
operator SOCKET()
{ return m_hSock;}
}
In above coscket class code, what operator it is overloading?
This is known as the type cast operator. Operators of the form;
operator Type()
where Type is the desired type, are generally known as cast operators and can be used in casting operations, such as static_cast<Type>(obj)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With