zoukankan      html  css  js  c++  java
  • Modern C++ Course [Lecture 8] {Smart/Unique/Shared pointers, Associative containers, Type casting, Enumeration, Binary files}

    only use them with heap memory. never ever apply them to stack

     

      

     

     

     

    try to avoid using "new and delete" if you can use shared or unique ptr

     

     

     

     delete the a_ptr twice: from } the stack wants to delete a_ptr, from unique_ptr, heap wants to delete a_ptr too.

     

     

    be cautious with line 8 comment!!!!!!!!!!!!!

     

     

     https://thispointer.com/map-vs-unordered_map-when-to-choose-one-over-another/

      

     

     

     

     

     

     

    ptr (&a) gets adjacted to be a ptr to a single byte type and then this ptr gets next byte, next byte, until it reaches sieof(a)

      

     My own implementation:

     

     results:

  • 相关阅读:
    11月20日
    11月19日
    11月26日
    11月25日
    生活有感(一)
    c# word 删除指定内容
    mysql insert语句
    c# 删除word文档中某一页
    mysql 相同表结构拷贝数据
    调试再次出错
  • 原文地址:https://www.cnblogs.com/ecoflex/p/10212194.html
Copyright © 2011-2022 走看看