Why scoped pointers in boost
问题 What is the objective of scoped pointer? to my understanding, the scoped pointer manages the memory within a block of code. If i want to declare a variable within a block , i can just declare it on a stack and not worry about cleaning. 回答1: Not if it's of dynamic size or type. In addition, scoped pointers can be swapped, and in C++11 unique_ptr can be moved, so they're not strictly scoped. 回答2: Unlike stack-based data, scoped_ptr has a reset() member -- in other words, you can construct