unique_ptr for mNet, and shared_ptr for mSolver?
shihuiguo opened this issue · comments
Is there any specific reason for adopting the usage of unique_ptr and shared_ptr? Is it related to the data synchronisation during the parallel computing?
Thanks.
Shihui
It was mainly to help prevent memory leaks.
Thanks Peng.
But is this approach mandatory or recommended? I am wondering whether I should adopt the same mechanism in my code, =)
Shihui
I think it's safer than using raw pointers.