E
exquisitus
What's the best way to notify callee that something went awry during
object creation (i.e. in constructor invocation) ?
Thanks
object creation (i.e. in constructor invocation) ?
Thanks
exquisitus said:What's the best way to notify callee that something went awry during
object creation (i.e. in constructor invocation) ?
Chris said:exquisitus wrote:
Just about the only thing you /can/ do is throw an exception.
I should add, though, that if there's enough logic in the constuctor for it to
be reasonable for it to go awry, then that /may/ be a hint that you've got too
much logic there.
-- chris
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.