- Throwing an assertion exception for proper stack unwinding, making sure destructors are called - On in Debug mode, in Release, enable via: cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_ASSERTIONS=ON Current problem that I'm seeing is that some code is not catching exceptions or worse silently swallowing them. Would like to check the whole pipeline before merging this in.
21 lines
312 B
C++
21 lines
312 B
C++
#ifndef OSRM_ASSERT_HPP
|
|
#define OSRM_ASSERT_HPP
|
|
|
|
#include <boost/assert.hpp>
|
|
|
|
#include <stdexcept>
|
|
|
|
namespace osrm
|
|
{
|
|
namespace util
|
|
{
|
|
// Assertion type to be thrown for stack unwinding
|
|
struct assertionError final : std::logic_error
|
|
{
|
|
assertionError(const char *msg) : std::logic_error{msg} {}
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif
|