Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 9 days agoI love new featureslemmy.zipimagemessage-square40fedilinkarrow-up1336arrow-down14
arrow-up1332arrow-down1imageI love new featureslemmy.zipMaven (famous)@lemmy.zip to Programmer Humor@programming.dev · 9 days agomessage-square40fedilink
minus-squareGladaed@feddit.orglinkfedilinkarrow-up3·8 days agoIn C++ you should never have owning raw pointers. Unless you have a good reason™. Raw pointers are great, but not for ownership.
minus-squareqaz@lemmy.worldlinkfedilinkEnglisharrow-up6·edit-28 days agoI just use unique_ptr 99% of the time
minus-squareGladaed@feddit.orglinkfedilinkarrow-up4·8 days agoAnd you should. It even works for classes whose constructors your implementation cannot see, if you aren’t a bitch about it.
In C++ you should never have owning raw pointers. Unless you have a good reason™.
Raw pointers are great, but not for ownership.
I just use
unique_ptr
99% of the timeAnd you should.
It even works for classes whose constructors your implementation cannot see, if you aren’t a bitch about it.