Re: [C++-sig] why does the "shared_ptr const&" silently become 0xCCCCCCCC

2009-03-13 Thread athor
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 Dave

Re: [C++-sig] why does the "shared_ptr const&" silently become 0xCCCCCCCC

2009-03-13 Thread athor
That is very very strange. Removing const should not change anything. If it does... well... black magic? The debugging link Dave provided is very important if you must compile debug versions. I remember something about not mixing debug/release versions of python but I just avoid the issue by never

Re: [C++-sig] why does the "shared_ptr const&" silently become 0xCCCCCCCC

2009-03-12 Thread athor
zaexage wrote: > > I got a 'class Manager' which contains a std::set of shared_ptr; > and 'class Entity' has a auto_ptr as member > and 'class StateMachine' needs shared_ptr as member variable to > access some functions outside. > > So, in order to break cyclic reference, I make the StateM

Re: [C++-sig] why does the "shared_ptr const&" silently become 0xCCCCCCCC

2009-03-12 Thread athor
Hi, I just tried your example and could not reproduce the "feature". I made a few minor modifications like fixing typos and adding a cout statement in the constructor of A but nothing that should affect the result. A few things that could cause you problems: * Passing shared_ptr by reference and