Depends on the weeds. Annual weeds are fine but the compost heap would need to reach a high temperature to kill off perennial weeds and that just isn't practical for the average gardener.
Personally, I would skip the lot to save spreading weeds and seeds across the entire garden, but that's just me.
If you want/need to sort through the pile, I would suggest sieving the lot at least.