kaycxx-assert
C++ assertion library
Loading...
Searching...
No Matches
Namespaces | Functions
assert_not_throw.hpp File Reference

Defines the assert_not_throw function. More...

#include <concepts>
#include <exception>
#include <format>
#include <functional>
#include <regex>
#include <string_view>
#include <utility>
#include <kaycxx/assert/assertion_error.hpp>
#include <kaycxx/assert/detail/source_location.hpp>
#include <kaycxx/assert/detail/exception_type.hpp>
#include <kaycxx/assert/detail/exception_type_name.hpp>
#include <kaycxx/assert/detail/to_string.hpp>
Include dependency graph for assert_not_throw.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  kaycxx
 Root namespace for kaycxx libraries.
 
namespace  kaycxx::assert
 Assertion functions and related types.
 

Functions

template<std::invocable Function>
void kaycxx::assert::assert_not_throw (Function &&function, std::string_view reason={}, std::optional< std::source_location > location=KAYCXX_ASSERT_DEFAULT_SOURCE)
 Asserts that the function does not throw any exception.
 
template<detail::exception_type Exception, std::invocable Function>
void kaycxx::assert::assert_not_throw (Function &&function, std::string_view unexpected_message, std::string_view reason={}, std::optional< std::source_location > location=KAYCXX_ASSERT_DEFAULT_SOURCE)
 Asserts that the function does not throw an exception of the given type with the exact unexpected message.
 
template<detail::exception_type Exception, std::invocable Function>
void kaycxx::assert::assert_not_throw (Function &&function, std::regex const &unexpected_message, std::string_view reason={}, std::optional< std::source_location > location=KAYCXX_ASSERT_DEFAULT_SOURCE)
 Asserts that the function does not throw an exception of the given type with a message matching the regex.
 

Detailed Description

Defines the assert_not_throw function.