I'm building a program which defines this function:-
Presumably some compilers accept the above and return a boost::shared_ptr<SysEx> that's equivalent to a NULL pointer. However, MSVC tells me that it can't convert an int to boost::shared_ptr<SysEx>. I changed the return value to look like this:-Code:boost::shared_ptr<SysEx> MidiRegionView::find_canvas_sys_ex (MidiModel::SysExPtr s) { // Some stuff to return a valid object // Or if that's not possible... return NULL; }
The compiler seems happy now - but is that the right way to return something that's equivalent to a NULL pointer?Code:boost::shared_ptr<SysEx> MidiRegionView::find_canvas_sys_ex (MidiModel::SysExPtr s) { // Some stuff to return a valid object // Or if that's not possible... return boost::shared_ptr<SysEx>(); }




Reply With Quote
