Since empty_iterator never points anything, so it always points null (it returns nullptr by operator->). but dereferencing null causes UB. Just calling std::terminate is of course better.