Skip to main content
added 42 characters in body
Source Link
anon
anon

You get undefined behaviour - you need to check that the container contains something using sizeempty() (which checks if the container is empty) before calling front().

You get undefined behaviour - you need to check that the container contains something using size() before calling front().

You get undefined behaviour - you need to check that the container contains something using empty() (which checks if the container is empty) before calling front().

fixed a typo
Source Link
JaredPar
  • 759.3k
  • 152
  • 1.3k
  • 1.5k

You get undefined behaviour - you need to check that the container contains something using size(0) before calling front().

You get undefined behaviour - you need to check that the container contains something using size(0 before calling front().

You get undefined behaviour - you need to check that the container contains something using size() before calling front().

Source Link
anon
anon

You get undefined behaviour - you need to check that the container contains something using size(0 before calling front().