Assume for a second we have
#include <boost/shared_ptr.hpp>
#include <iostream>
int main()
{
boost::shared_ptr<int> bleah(); //default constructor
cout << bleah.get() << endl; //error line
boost::shared_ptr<int> barf(new int (10));
cout << *barf.get() << endl; //outputs 10 as normal.
}
How come this does not compile? It's as if the function shared_ptr::get just all of a sudden disappeared from the class definition for the variable "bleah". I'm sure there's a reason, but I cannot see it at the moment.