Created BaseException that can act as a stringstream. You can do the following: throw BaseException() << "some error " << variable << " foo"; Changed InvalidSettings to use BaseException, using this new syntax in Settings.