library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub matumoto1234/library

:x: tools/assert-msg.hpp

Depends on

Required by

Verified with

Code

#pragma once

#include "base.hpp"

#include <cstdlib>
#include <iostream>
#include <string>

namespace matumoto {
#define assert_msg(expr, msg) (static_cast<bool>(expr) ? void(0) : assert_fail(__FILE__, __LINE__, #expr, msg))

  namespace {
    void assert_fail(const char *file, int line, const char expr_str[], string msg) {
      cerr << "File: " << file << "\n"
           << "Line: " << line << "\n"
           << "Assertion '" << expr_str << "' failed.\n"
           << "Message: " << msg << "\n";
      abort();
    }
  } // namespace
} // namespace matumoto
#line 2 "tools/assert-msg.hpp"

#line 2 "tools/base.hpp"

namespace matumoto {
  using namespace std;
}
#line 4 "tools/assert-msg.hpp"

#include <cstdlib>
#include <iostream>
#include <string>

namespace matumoto {
#define assert_msg(expr, msg) (static_cast<bool>(expr) ? void(0) : assert_fail(__FILE__, __LINE__, #expr, msg))

  namespace {
    void assert_fail(const char *file, int line, const char expr_str[], string msg) {
      cerr << "File: " << file << "\n"
           << "Line: " << line << "\n"
           << "Assertion '" << expr_str << "' failed.\n"
           << "Message: " << msg << "\n";
      abort();
    }
  } // namespace
} // namespace matumoto
Back to top page