Skip to content

Instantly share code, notes, and snippets.

@Offirmo
Last active February 6, 2024 09:44
Show Gist options
  • Save Offirmo/e762f388da448bb71eb0ed5d023c824e to your computer and use it in GitHub Desktop.
Save Offirmo/e762f388da448bb71eb0ed5d023c824e to your computer and use it in GitHub Desktop.
[C++ libs usage]
// all libs
// https://en.cppreference.com/w/cpp/header
////////////
#include <iostream>
std::cout << "Hello, world!" << std::endl;
////////////
// https://en.cppreference.com/w/cpp/error/assert
// uncomment to disable assert()
// #define NDEBUG
#include <cassert>
assert(1 == 2);
////////////
// https://en.cppreference.com/w/cpp/utility/program/abort
#include <cstdlib>
// normal termination
std::exit(EXIT_SUCCESS)
std::exit(EXIT_FAILURE)
// abnormal termination without cleanup
std::abort();
////////////
// https://en.cppreference.com/w/cpp/error/errc
<system_error>
std::error_code error_code
if (error_code == std::errc::invalid_argument)...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment