Some insights on Rewriting virtual functions

Source: Internet
Author: User

Someone's code was read to complete TCP/IP jobs. The idea is good, but the code is a bad one! If you do not have the necessary strength or have a deep understanding of the implementation principles, do not try to rewrite the virtual functions (especially the C ++ destructor such as onclose, the self-called destructor of the system are better than the Destructor written by most cainiao, even though the class is built by cainiao itself). Otherwise, let's wait for various crashes. It is good to think about releasing the space occupied by the temporary variables at the end, but you can add a few Delete before calling the built-in end function. Do you want to rewrite the virtual function ?!

Also, you can write "include 'header files' in CPP, and write the dry hair to the header file attached to CPP.

I used to go to duniang to find the corresponding direct example when I was lazy. I found hundreds of errors in the document and didn't directly post the code, it was done only when I tried to correct the original author's mistakes. For more information, see the document.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.