namespace mrpt::internal

Overview

namespace internal {

// structs

struct ClockState;

template <std::size_t N>
struct num;

// global functions

template <class F, std::size_t... Is>
void for_(
    F func,
    std::index_sequence<Is...>
    );

unsigned int MAX_BACKTRACE_DEPTH();

std::string exception_line_msg(
    const std::string_view& msg,
    const char* filename,
    unsigned int line,
    const char* function_name
    );

template <typename A, typename B>
std::string asrt_fail(
    std::string s,
    A&& a,
    B&& b,
    const char* astr,
    const char* bstr
    );

template <typename A, typename B, typename T>
std::string asrt_fail_near(
    std::string s,
    A&& a,
    B&& b,
    T&& tol,
    const char* astr,
    const char* bstr,
    const char* tolstr
    );

void asrt_throw(
    const std::string& msg,
    const char* file,
    unsigned int line,
    const char* func
    );

template <typename A, typename B, typename OK>
constexpr void asrt_check(
    const char* cond,
    const A& a,
    const B& b,
    OK ok,
    const char* astr,
    const char* bstr,
    const char* file,
    unsigned int line,
    const char* func
    );

template <typename A, typename B, typename T>
constexpr void asrt_check_near(
    const A& a,
    const B& b,
    const T& tol,
    const char* astr,
    const char* bstr,
    const char* tolstr,
    const char* file,
    unsigned int line,
    const char* func
    );

std::istringstream& get_istringstream();
void impl_excep_to_str(const std::exception& e, std::string& ret, ] unsigned int lvl = 0);

} // namespace internal

Global Functions

void asrt_throw(
    const std::string& msg,
    const char* file,
    unsigned int line,
    const char* func
    )

Throws an ASSERT_*() failure as THROW_EXCEPTION() would at the caller’s file, line and function.

template <typename A, typename B, typename OK>
constexpr void asrt_check(
    const char* cond,
    const A& a,
    const B& b,
    OK ok,
    const char* astr,
    const char* bstr,
    const char* file,
    unsigned int line,
    const char* func
    )

The check behind the comparison ASSERT_*() macros: throws unless ok(a, b).

The operands are function arguments, so a temporary they refer to (e.g. the optional in f()->x) lives until the check is done; a local reference bound to them would dangle. Nothing non-literal is declared in the caller, so the macros also work in constexpr functions.

template <typename A, typename B, typename T>
constexpr void asrt_check_near(
    const A& a,
    const B& b,
    const T& tol,
    const char* astr,
    const char* bstr,
    const char* tolstr,
    const char* file,
    unsigned int line,
    const char* func
    )

Like asrt_check(), for ASSERT_NEAR_().

void impl_excep_to_str(
    const std::exception& e,
    std::string& ret,
    ] unsigned int lvl = 0
    )

Recursive implementation for mrpt::exception_to_str()