Remix.run Logo
dataflow 3 hours ago

Depends on where you're coming from, but some people would expect it to enforce that the pointer is non-null, then proceed. Which would actually give you a guaranteed crash in case it is null. But that's not what it does in C++, and I could see it not being entirely obvious.

IshKebab 2 hours ago | parent [-]

Assert doesn't work like that in any language.

comex 2 hours ago | parent [-]

It does in Rust: assert is always enabled, whereas the debug-only version is called debug_assert.

But yes, “assert” in most languages is debug-only.