Use another exception if you want to specify text, or just throw a bad_cast without any error message (throw std::bad_cast();). A compiler-generated one will be displayed if you call what().