In C++ it's idiomatic to make anything that

  • can be prevented by careful coding and
  • would incur runtime cost to protect against

an undefined behavior.

(@jan-hudec)