I think that is a sad state of affairs if as you suggest that many people carry small gas cans in case they forget to fill up.

Warning lights often with an audible signal that come on while you still have ample range to get to a station have been common place for at least a couple of decades.  Further most vehicles built in the past 10 years or more have digital displays of your estimated range to empty.

Is there really any excuse for running out of gas?  Particularly if you are travelling in an area so congested that these types of measures are considered necessary?