const shared pointer copy issue | Custom shared pointer
Refer code below: https://www.sololearn.com/compiler-playground/c6Sga08lo7x4 Is my implementation correct? I am yet to implement move constructor and move assignment operator. But feel free to share your valuable feedback on this implementation. There is a compiler error due to copy constructor. Refer last few lines of main function. ptr1 is a constant object. And as it is constant object, copy constructor expects copy constructor signature must be as below: my_shared_ptr(const my_shared_ptr<T>& pOther); But doing this also results into a compiler issue. pOther cannot be constant because it will not allow below line: ++(*pOther.m_intCnt); In short, can anyone please suggest to avoid compiler error? And also feel free to share other feedback as well.