There's a lot to love about standard smart pointers in general, and unique_ptr in particular. Problem JG Question 1.什么时候你应该使用shared_ptr vs unique_ptr?尽可能列出你所想到的注意事项. Guru Question 2.为什么你应该总是使用make_shared来创建一个被shared_ptr(s)拥有的对象?请解释. 3.为什么你应该总是使用make_…
函数尾部的const是什么意思? 1 Answer by Jnick Bernnet A "const function", denoted with the keyword const after a function declaration, makes it a compiler error for this class function to change a member variable of the class. However, reading of a class v…