Not by gender, but by ability. If a woman can handle it, there is no gender restrictions, but naturally lot's of women are better suited for some roles than others. Even in all male units, the heavy weapons are usually carried by the strong - or at least not the skinny guy in the platoon.
Women are often drivers or commander/gunner of the APC for an example, while they rarely carry the heaviest of weaponry, but exceptions to the rule do occur when a woman is up to the task.
Actually, mixed units function better. How do you search an Afghan woman in a Burka, with an all male unit? Or even worse, would you let a female soldier stripsearch an Afghan man? Only if you had no alternative, since such actions would be considdered very insulting.
Another thing is that many women aren't aggressive enough to function well as combat troops when they start. After a year in a mostly male unit, they change. However, if they didn't have the male influence, I doubt they would function as well in combat.
The same way, the women often influence the men, since they are often more serious, less gung ho, more focussed. The best units, in my experience, have a few hardcore women, who can adapt and dosn't expect special treatment. It's not good if they are too "girly".