Doesn't it drive you crazy when you can literally feel the person queuing so closely behind you, their hot breath on your neck? Or actually touching you?! Why people think it's okay to stand so close to a stranger, just because their back is turned, is utterly beyond me.
This problem is not unique to people on the spectrum though. There are plenty of supposedly neurotypical people who need to learn this lesson in queue etiquette.
When it happens to me, what I really want to do is turn 180 degrees and face the person - at which point they would realise how much they have invaded my personal space, based on the fact that our noses are actually touching. I have a friend who says she throws her bag over her shoulder, knowing that if they are standing too close, they will be hit by the bag. I'm not personally comfortable with doing that, but I completely understand the sentiment.
So, if you're standing in a queue, what's the right distance between you and the person in front of you? The basic, easy to remember rule is...
Always leave an arm's length in front of you when you stand in a queue.
If you're unsure of the distance, practise with someone at home first. Get them to stand in front of you. Curl your fingers into a fist, and reach out your arm straight in front of you. If you can reach the person in front you are too close.
And if someone's uncomfortably close behind you, try turning sideways, facing your shoulder in their direction. It's not as confronting as directly facing them, but it's close enough to the real thing that they do tend to take a step back.