kaycxx-assert
C++ assertion library
Loading...
Searching...
No Matches
assert_not_contain

Asserts that a string does not contain text or that a range does not contain an element.

String-like values use substring semantics. Other ranges use element lookup through std::ranges::find, so an element must compare equal to the unexpected value to fail.

#include <vector>
using namespace kaycxx::assert;
int main() {
assert_not_contain("hello world", "error");
assert_not_contain("abc", 'x');
auto values = std::vector{1, 2, 3};
assert_not_contain(values, 4);
}
Includes the complete public assertion API.
Assertion functions and related types.
Definition assert.hpp:15

Null C string pointers do not contain anything and therefore pass assert_not_contain.