13#include "lib/exceptions.h"
46 auto *result =
to<T>();
47 BUG_CHECK(result,
"Cast failed: %1% is not a %2%",
this,
typeid(T).name());
54 auto *result =
to<T>();
55 BUG_CHECK(result,
"Cast failed: %1% is not a %2%",
this,
typeid(T).name());
T & as()
Tries to convert the class to type T. A BUG occurs if the cast fails.
Definition castable.h:39
const T * checkedTo() const
Performs a checked cast. A BUG occurs if the cast fails.
Definition castable.h:45
const T & as() const
Tries to convert the class to type T. A BUG occurs if the cast fails.
Definition castable.h:33
T * checkedTo()
Performs a checked cast. A BUG occurs if the cast fails.
Definition castable.h:53
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13
T * to() noexcept
Definition rtti.h:226