Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.25 KB

bad_delegate_call.md

File metadata and controls

56 lines (40 loc) · 1.25 KB

rome:: bad_delegate_call

Defined in header <rome/delegate.hpp>.

class bad_delegate_call;

rome::bad_delegate_call is the type of exception thrown when an empty rome::delegate is invoked.

rome::bad_delegate_call inherits from std::exception

Member functions

  • constructor
    constructs the rome::bad_delegate_call object

    bad_delegate_call() noexcept;
  • destructor - virtual
    destroys the exception object

    virtual ~bad_delegate_call();
  • what - virtual, inherited from std::exception
    returns the explanatory string "rome::bad_delegate_call"

    const char* what() const noexcept override;

Example

See the code in examples/bad_delegate_call.cpp.

#include <iostream>
#include <rome/delegate.hpp>

int main() {
    rome::delegate<void(), rome::target_is_expected> d{};
    try {
        d();
    }
    catch (const rome::bad_delegate_call& e) {
        std::cout << "caught: " << e.what() << '\n';
    }
}

Output:

caught: rome::bad_delegate_call