The problem looks identical to one described in bug
#101889.
http://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=101889
There is only one difference - intrusive_ptr instead of shared_ptr
originally reported in #101889
The code bellow causes assertion:
boost::intrusive_ptr<test_ptr> ptr;
if(ptr)
assert(false); //MUST NOT HAPPEN BUT IT DOES!
Reproduced on VS2005 SP1 and VS2008 SP1 (Windows XP SP2)
Boost 1.38
To
reproduce the problem, the Boost (booost/smart_ptr.hpp in our case)
shall be included in the CLI-compiled file under #pragma managed
(push,off) (see the code below)
If changed to "#pragma managed (push,on)", then everything is fine