id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 11879,Incorrect use of reset cause unexpected impact on previous code segment,anonymous,Peter Dimov,"#include #include int main() { boost::scoped_ptr p{new int{1}}; std::cout << *p << '\n'; std::cout << p.get() << '\n'; p.reset(new int{2}); std::cout << *p.get() << '\n'; std::cout << p.get() << '\n'; p.reset((int *)4); //Problem: Because of this statement std::cout of above lines are not printing anything. When this line is commented the program works fine. I understand I have used reset function incorrectly but it should impact to the next statements but it is also impacting above statements too. Please explain the cause. std::cout << *p.get() << '\n'; std::cout << p.get() << '\n'; p.reset(); std::cout << std::boolalpha << static_cast(p) << '\n'; }",Bugs,new,To Be Determined,smart_ptr,Boost 1.57.0,Problem,,,