и получить сообщение об ошибке?
                  
                  
                  
                  
                  
                  Что я сейчас делаю:
                  
                  
                  if (!_gl_context){
                  
                  
                      throw SDLException("Can not create an OpenGL context!");
                  
                  
                  }
                  
                  
                  
                  
                  
                  Что получаю:
                  
                  
                  terminate called after throwing an instance of 'SDLException'
                  
                  
                  
                  
                  
                  Что хочу:
                  
                  
                  terminate called after throwing an instance of 'SDLException("Can not create an OpenGL context!")'
                  
                  
                  
                  
                  
                  Вот мой класс exception'а:
                  
                  
                  struct SDLException {
                  
                  
                      const char *description;
                  
                  
                      SDLException(const char *description)
                  
                  
                          :description(description){}
                  
                  
                  
                  
                  
                      operator const char *() const {
                  
                  
                          return description;
                  
                  
                      }
                  
                  
                      const char* what() const{
                  
                  
                          return this->description;
                  
                  
                      }
                  
                  
                  };
                  
                  
                
catch(SDLException &sdl) { fprintf(stderr, "Terminate called after throwing an instance of 'SDLException(\"%s\")'\n", sdl.what()); std::terminate(); }
Тебе надо ) Наследоваться от std:: exception ) Определить в main блок try
Обсуждают сегодня