0

Shared pointer with two template parameter

Hi Below is my shared pointer implementation: https://www.sololearn.com/en/compiler-playground/cckRLm8Eai3f I am confused about last line in main function. I thought it should give me compilation error as we needed to have copy constructor implemented taking two template parameters T and U. Why it is not throwing error? What is this enhancement? https://sololearn.com/compiler-playground/cckRLm8Eai3f/?ref=app

31st Aug 2024, 12:14 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
2 odpowiedzi
0
maybe you were thinking of sharedptr<base> bdptr(dptr); ? This is not defined.
31st Aug 2024, 1:45 PM
Bob_Li
Bob_Li - avatar
+ 1
Thanks. It's what I was missing.
31st Aug 2024, 3:44 PM
Ketan Lalcheta
Ketan Lalcheta - avatar