Oh, Thank god, so at least it is not only me. :) I just double-check this, and this behavior not only happened in debug build, it will happen in release build too, But the pointer showing up would not be 0xcccccccc but something arbitrary.
P.S.: I have already changed to follow you guys' advices to pass by value, and I will try best to avoid this reference swamp. On Fri, Mar 13, 2009 at 4:57 PM, athor <thor...@gmail.com> wrote: > > I just reproduced the behaviour. Out of habit, I compiled with release the > last time. Using a debug build, I get the same behaviour (using const&, > non-const& etc). > > I'm guessing this is a case of "undefined behaviour" resulting from mixing > Debug/Release dll's. Changing to Release (or reading Daves link) should > help. > > Passing shared_ptr by value and not by ref is still recommended though :) > > -- > View this message in context: > http://www.nabble.com/why-does-the-%22shared_ptr%3CX%3E-const-%22-silently-become-0xCCCCCCCC-tp22449314p22492427.html > Sent from the Python - c++-sig mailing list archive at Nabble.com. > > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig@python.org > http://mail.python.org/mailman/listinfo/cplusplus-sig > -- Time is mana, we must hurry
_______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig