libassert
libassert copied to clipboard
The most over-engineered C++ assertion library
Currently, the following code fails to compile: ```cpp template bool foo() { return X == Y; } int main() { foo(); ASSERT(foo()); } ``` This code can be seen in...
This is experimental support for MacOS, which mainly bases on properly loading Mach-O binaries and using NS functions for getting some data. Note however, that this currently does not work...
```cpp terminating with uncaught exception of type std::__1::regex_error: The expression contained an invalid back reference. zsh: abort ./a.out ``` Thrown on line 1080 https://github.com/jeremy-rifkin/libassert/blob/39a1babf70585e4b2e2361adc257da3ed6ae792e/src/assert.cpp#L1074-L1081
```cpp #include "assert.hpp" int main() { const char* path = "\\hello\\test\\"; ASSERT(0, "", path); } ``` 
Currently, in order to use `libassert` via vcpkg the following seems to be required: ``` find_package(cpptrace CONFIG REQUIRED) set(assert_DIR ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/libassert) find_package(assert CONFIG REQUIRED) ``` The `find_package(cpptrace CONFIG REQUIRED)` is required...
`cpptrace` build fails. See log file below: ``` Change Dir: 'C:/vcpkg/cpptrace/x64-windows-dbg' Run Build Command(s): C:/Users/Nick/Documents/Projects/project/vcpkg/downloads/tools/ninja/1.10.2-windows/ninja.exe -v -v -j17 install [1/19] C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\cl.exe /TP -DCPPTRACE_DEMANGLE_WITH_WINAPI -DCPPTRACE_GET_SYMBOLS_WITH_DBGHELP -DCPPTRACE_UNWIND_WITH_DBGHELP -Dcpptrace_lib_EXPORTS -IC:\vcpkg\cpptrace\src\v0.3.0-3f6edebffe.clean\include -external:IC:\vcpkg\cpptrace\x64-windows-dbg\include -external:W0 /nologo...
No MRE so far but I got the following `-Wgnu-zero-variadic-macro-arguments` warning with Clang 14 on WSL: ``` /mnt/d/Morwenn/Projets/cpp-sort/build-ubuntu-clang/libassert-src/include/assert.hpp:146:83: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]...
I haven't explored catch2 or gtest integration, but it would be awesome to do this
A few weeks ago, C++ Contracts support was merged into GCC: - https://www.reddit.com/r/cpp/comments/yz3l4v/gcc_13_gets_contracts_in_master/ One thing I keep thinking is how great it would be to be able to use `libassert`...