optional<string>name;if(database.open()){name.reset(database.lookup(employer_name));}else{if(can_ask_user)name.reset(user.ask(employer_name));}if(name)print(*name);elseprint("employer's name not found!");

classfigure{public:figure(){// data member 'm_clipping_rect' is uninitialized at this point.
}voidclip_in_rect(rectconst&rect){....m_clipping_rect.reset(rect);// initialized here.
}voiddraw(canvas&cvs){if(m_clipping_rect)do_clipping(*m_clipping_rect);cvs.drawXXX(..);}// this can return NULL.
rectconst*get_clipping_rect(){returnget_pointer(m_clipping_rect);}private:optional<rect>m_clipping_rect;};