What you have is not legal. You must initialize it in the constructor:
AguiWidgetBase::AguiWidgetBase() : onPaintCallback(0) {}
You can use boost::function<void(AguiRectangle)> , which, in addition to flexibility, correctly initializes the null value. You can check this as:
if (f)
source share