Maipa's Standard Library Extension 1.5.6
mstd
Loading...
Searching...
No Matches
assert.hpp
1/*
2 * mstd - Maipa's Standard Library
3 *
4 * Licensed under the BSD 3-Clause License with Attribution Requirement.
5 * See the LICENSE file for details: https://github.com/MAIPA01/mstd/blob/main/LICENSE
6 *
7 * Copyright (c) 2025, Patryk Antosik (MAIPA01)
8 */
9
10#pragma once
11#ifndef _MSTD_ASSERT_HPP_
12 #define _MSTD_ASSERT_HPP_
13
14 #include <mstd/config.hpp>
15
17_MSTD_WARNING("this is only available for c++17 and greater!");
18 #else
19
20 #include <mstd/assert_base.hpp>
21
22 #pragma region MSTD_ASSERT
23 #if _DEBUG
24 // NOLINTNEXTLINE
25 #define mstd_assert(expression, ...)
26 MSTD_STOP_ASSERT_BASE(expression, [](const std::string_view&) -> void {} __VA_OPT__(, ) __VA_ARGS__)
27 #elif !defined(MSTD_DISABLE_ASSERT_ON_RELEASE)
28 // NOLINTNEXTLINE
29 #define mstd_assert(expression, ...)
30 MSTD_STOP_ASSERT_BASE(expression, [](const std::string_view&) -> void {} __VA_OPT__(, ) __VA_ARGS__)
31 #else
32 // NOLINTNEXTLINE
33 #define mstd_assert(expression, ...)
34 MSTD_EMPTY_ASSERT_BASE(expression, [](const std::string_view&) -> void {} __VA_OPT__(, ) __VA_ARGS__)
35 #endif
36 #pragma endregion
37
38 #endif
39#endif
#define MSTD_STOP_ASSERT_BASE(expression, log_error_func,...)
Definition assert_base.hpp:71
#define _MSTD_HAS_CXX17
Definition config.hpp:45