I am trying to create an exception class in C ++ and it does not work. I have reduced the code to a minimum, and I still cannot find the error. Here is my header file:
#ifndef LISTEXCEPTION_H
#define LISTEXCEPTION_H
#include <exception>
class ListException: public exception {
};
#endif
and here is the error I get:
error: expected class-name before ‘{’ token
This is pretty unexpected. How to solve this?
source
share