In a library I have a function which searches for a key in a database and return a non-const reference to an object. I want to handle the case in which the key is not found,
A library should never exit the hostest application.
use "return null", get into an "inconsistent state" whichin to every call you return NULL. the library user will have to handle it.
or exceptions...