Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 494 Bytes

File metadata and controls

19 lines (12 loc) · 494 Bytes

assert_null

Asserts that a raw pointer or nullptr value is null.

This assertion is intentionally limited to raw pointers and std::nullptr_t. It does not treat smart pointers or arbitrary nullable-looking classes as null values.

#include <kaycxx/assert.hpp>

using namespace kaycxx::assert;

int main() {
    int* value = nullptr;

    assert_null(value);
}

Use this instead of assert_true(pointer == nullptr) so failures report the pointer value as a nullness assertion.