User Tools

Site Tools


programming:cpp:exception

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
programming:cpp:exception [2022/05/05 07:33]
odagawa
programming:cpp:exception [2022/05/05 11:09] (current)
odagawa
Line 23: Line 23:
     throw std::runtime_error("Runtime error : " << "内容");     throw std::runtime_error("Runtime error : " << "内容");
  
-  } catch ( std::runtime_error &error ) {+  } catch ( const std::runtime_error &error ) {
     std::cerr << error.what() << std::endl;     std::cerr << error.what() << std::endl;
     std::exit(1);     std::exit(1);
-  } catch ( std::invalid_argument &error ) {+  } catch ( const std::invalid_argument &error ) {
     std::cerr << error.what() << std::endl;     std::cerr << error.what() << std::endl;
     std::exit(1);     std::exit(1);
programming/cpp/exception.1651736017.txt.gz · Last modified: 2022/05/05 07:33 by odagawa