> TextTool::TextTool(QDialog *taskDialogue) : Tool(this->name)
> {
> boost::shared_ptr<TextTool> pointerToThis =
> TextTool::shared_from_this(); //ERROR OCCURS ON THIS LINE
>
> bold = boost::shared_ptr<ToggleControl>(new
> ToggleControl(pointerToThis));
> }
You cannot call shared_from_this in the constructor. Instead, you can
define a static constructing method, like this:
// untested!!
static boost::shared_ptr<TextTool> TextTool::create(QDialog *taskDialogue)
{
boost::shared_ptr<TextTool> pointerToThis(new TextTool(taskDialogue));
pointerToThis->bold.reset(new ToggleControl(pointerToThis));
return pointerToThis;
}
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users