ICode9

精准搜索请尝试: 精确搜索
  • Effective C++读书笔记~7 模板与泛型编程2021-12-06 09:04:32

    目录条款41:了解隐式接口和编译期多态显式接口和运行期多态隐式接口和编译期多态小结条款42:了解typename的双重意义小结条款43:学习处理模板化基类内的名称编译器无法识别模板基类内名称解决办法小结条款44:将与参数无关的代码抽离templates小结条款45:运用成员函数模板接受所有兼容类

  • C++常见面试题总结2021-09-27 20:03:06

    C++常见面试题总结1---C++指针 无效指针、野指针、悬空指针void* 指针函数指针this指针const与指针用指针有什么好处?指针使用过程中有哪些注意事项?指针和引用的区别?引用的底层也是指针实现的,内置类型指针传递和引用传递的汇编代码是一样的,那C++为什么还需要引入引用呢?既然C

  • c++ 智能指针的简单实现2021-09-04 17:05:49

    手撕智能指针,emmmmm show me the code #include <iostream> using namespace std; template<typename T> class smartPtr { private: T* _ptr; int* _count; public: smartPtr(T* ptr = nullptr) :_ptr(ptr), _count(new int(1)) { cout << "Construc

  • 智能指针2021-09-01 10:01:58

    #include <iostream> using namespace std; template<class T> class SmartPtr{ public: explicit SmartPtr():ptr(nullptr), count(new int(0)){} explicit SmartPtr(T* p):ptr(p), count(new int(0)){ *count = 1; } ~SmartPtr(){

  • C++智能指针简单实现2020-04-04 13:02:32

      share_ptr 简单实现: #include <iostream> using namespace std; template<class T> class SmartPtr { public: SmartPtr(T* ori_ptr); ~SmartPtr(); SmartPtr(SmartPtr<T>& ori_ptr); SmartPtr<T>& operator=(const SmartP

  • SmartPtr2020-01-10 23:01:14

    // smart pointer implements #include <iostream> #include <memory> using namespace std; template<typename T> class SharePtr; template<typename T> class ResPtr { // manage res of memory private: T* res_p; // point res

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有