Skip to content

File assert.hpp

FileList > assert > assert.hpp

Go to the source code of this file

  • #include <iostream>
  • #include <optional>
  • #include <experimental/source_location>
  • #include <sstream>
  • #include <string>
  • #include "printing/to_string.hpp"
  • #include "utilities/trace_recorder.hpp"

Namespaces

Type Name
namespace std

Public Functions

Type Name
void _Assert (bool condition, const std::string & condition_str, const std::optional< std::string > & message, const std::source_location & loc=std::source_location::current())
void _AssertBinOp (const A & a, const B & b, const std::string & a_str, const std::string & b_str, bool result, const std::string & op, const std::string & nop, const std::source_location & loc=std::source_location::current())
void unreachable ()

Macros

Type Name
define Assert (condition, ...) /* multi line expression */
define AssertBinOp (a, b, op, nop) /* multi line expression */
define AssertEQ (expr, val) AssertBinOp(expr, val, ==, !=)
define AssertGE (expr, val) AssertBinOp(expr, val, &gt;=, &lt;)
define AssertGT (expr, val) AssertBinOp(expr, val, &gt;, &lt;=)
define AssertLE (expr, val) AssertBinOp(expr, val, &lt;=, &gt;)
define AssertNE (expr, val) AssertBinOp(expr, val, !=, ==)
define Fail (...) /* multi line expression */
define HAS_BUILTIN (x) \_\_has\_builtin(x)
define Unimplemented (...) Assert(false, "Unimplemented")

Public Functions Documentation

function _Assert

inline void _Assert (
    bool condition,
    const std::string & condition_str,
    const std::optional< std::string > & message,
    const std::source_location & loc=std::source_location::current()
) 

function _AssertBinOp

template<typename A, typename B>
inline void _AssertBinOp (
    const A & a,
    const B & b,
    const std::string & a_str,
    const std::string & b_str,
    bool result,
    const std::string & op,
    const std::string & nop,
    const std::source_location & loc=std::source_location::current()
) 

function unreachable

inline void unreachable () 

Macro Definition Documentation

define Assert

#define Assert (
    condition,
    ...
) `/* multi line expression */`

define AssertBinOp

#define AssertBinOp (
    a,
    b,
    op,
    nop
) `/* multi line expression */`

define AssertEQ

#define AssertEQ (
    expr,
    val
) `AssertBinOp(expr, val, ==, !=)`

define AssertGE

#define AssertGE (
    expr,
    val
) `AssertBinOp(expr, val, >=, <)`

define AssertGT

#define AssertGT (
    expr,
    val
) `AssertBinOp(expr, val, >, <=)`

define AssertLE

#define AssertLE (
    expr,
    val
) `AssertBinOp(expr, val, <=, >)`

define AssertNE

#define AssertNE (
    expr,
    val
) `AssertBinOp(expr, val, !=, ==)`

define Fail

#define Fail (
    ...
) `/* multi line expression */`

define HAS_BUILTIN

#define HAS_BUILTIN (
    x
) `__has_builtin(x)`

define Unimplemented

#define Unimplemented (
    ...
) `Assert(false, "Unimplemented")`


The documentation for this class was generated from the following file /home/runner/work/Blaze/Blaze/src/lib/assert/assert.hpp