
28 Mar
2005
28 Mar
'05
10:10 p.m.
Rather disturbingly, the following code compiles (at least, with g++-3.3.2): #include "boost/shared_ptr.hpp" using namespace boost; class X {}; int main() { const shared_ptr<X> y; delete y; } Normally, when you compile code with delete applied to a non-pointer type, you get a compile-time error. What's going on here? TIA, Dan.