Snaipe / libcsptr

Smart pointers for the (GNU) C programming language
https://snai.pe/c/c-smart-pointers/
MIT License
1.57k stars 143 forks source link

Reassignement ? #18

Open cppmadguy opened 3 years ago

cppmadguy commented 3 years ago

I am a big fan of bringing unique_ptr to GNU C. But I think there is a difference beetween your repo and the cpp standard: reading this https://en.cppreference.com/w/cpp/memory/unique_ptr/operator%3D What happens if I reassign a value ? Is this GNU-C undefined behaviour ?

Reading the exemples, you never return unique_ptr from functions. Again, if it is not possible, it is a key difference with c++ unique_ptr.