From: Marco Costalba (mcostalba_at_[hidden])
Date: 2008-03-22 15:49:19


On Sat, Mar 22, 2008 at 8:21 PM, Kevin Scarr <kscarr_at_[hidden]> wrote:
> Marco Costalba wrote:
> > So, I would like to ask you what exception type do you suggest could
> > be suitable to throw in this case?
>
> Interestingly, I looked at the std::exception classes as well when I saw
> your earlier post and, I agree, there is nothing that leaps out as
> directly appropriate.
>

Ok, I have stolen boost.function exception:

    struct bad_function_call : std::runtime_error
    {
      bad_function_call() : std::runtime_error("call to empty function") {}
    };

With this I have two things:

- A correct exception to throw when an empty slot is called

- The proof that you are right: it's idiomatic to throw an exception
in this case

I plan to post an update with exception's support (I have already
implemented it in the meantime ;-) just after Easter holidays (Monday
evening), so to leave some time for other suggestions.

Thanks again
Marco