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
-
constructor
constructs therome::bad_delegate_call
objectbad_delegate_call() noexcept;
-
destructor - virtual
destroys the exception objectvirtual ~bad_delegate_call();
-
what - virtual, inherited from
std::exception
returns the explanatory string "rome::bad_delegate_call"const char* what() const noexcept override;
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