user12383896
user12383896

Reputation:

QT Creator defining exceptions

I want to define a simple exception but when I do this Im getting an error saying "expected class name"

#include <exception>
class MyException : public exception{
    
};

This is in a QT (https://www.qt.io/) widget application. Wont let me inherit from exception, why is this?

Upvotes: 0

Views: 57

Answers (1)

malek.khlif
malek.khlif

Reputation: 85

#include <exception>

class MyException : public std::exception{
    
};

Upvotes: 1

Related Questions