24 ms·
Agree about unit tests. But asserts are used also to catch invalid _use_ of functions. void f(size_t x) { assert(x); // calling f with 0 is bug
by 112233 9y ago
Agree about unit tests. But asserts are used also to catch invalid _use_ of functions.
void f(size_t x) {
assert(x); // calling f with 0 is bug
}
constexpr f(size_t x) {
?????(x != 0); // <- what to write here?
}