There'sThere are some added complexities here that Matthew's answer hasn't addressed, especially in the meanings of words like group and disadvantage. LetsLet’s focus on the latter of the two and proceed by way of example.
Ergo, since the language is vague, it's thus an unfortunate fact of life that the legality of such things mostly depends mostly on the politics and broader zeitgeist within which the case is heard. Left-leaning judges will tend to decide that the members of the group under question are at an overall disadvantage, despite discrimination working in their favour, and will thus tend to hold that such discrimination is lawful, while anti-left judges will tend to decide that the members of the group under question are at an overall advantage and thus that further discrimination in their favour is unlawful.
Based on the above comments, discrimination in favour of such groups will tend to be regarded as lawful in the current intellectual climate. But in my opinion, common-sense sense dictates that the left-leaning definition of disadvantage upon which such decisions are based doesn't really stand up to scrutiny, and as time goes on and society cycles through different worldviews, I think that a consensus will eventually emerge that the anti-left conception of disadvantage makes by far the most sense. Therefore, I consider it likely that the judicial system will ultimately begin to rule that such affirmative action policies are illegal. Indeed, I think judges will eventually declare that these kinds of policies were always illegal, but that this simply wasn't recognised at the time for political reasons.
The broader question here is whether 'lack of applicants' is a form of disadvantage that can be used to justify the lawfulness of discriminatory practices. My point is really that we can't answer this from the legislation alone, and are thereby forced to rely on the kinds of precedents discussed in Matthew's answer. But realistically, these precedents don't make much sense with respect to common-sense sense notions of disadvantage, and thus are likely to change in the future. I don't necessarily mean that right-leaning judges will swoop in and totally override the precedents. Another possibility, for example, is that a general sense of disenchantment with partizanpartisan thinking will infiltrate top-tier courts; if this happens, common-sense sense points of view will stand a better chance of becoming precedents.
it seems quite likely that an overall male disadvantage will eventually be settled upon by the scientific community. Let's call this Outcome 1. A contrary possibility is that by factoring in e.g. partner-violence, etc., the establishment will arrive at the opposite conclusion. Let's call this Outcome 2. Yet another possibility is that the scientific establishment will eventually decide that there's no apolitical way to weigh up the costs and benefits of belonging to the genders under question. Let's call this Outcome 3.
Notice that if either Outcomes 1 or 3 transpire, courts higher up in the judicial hierarchy will eventually start deciding that many of these broader life-advantage arguments don't carry much weight anymore, especially if the broader spirit-of-the-times changes.
Also, I should clarify my position a bit more. My opinion is specifically that it will eventually be recognized that most of these policies were illegal all long. But I'm not saying that such policies should be illegal. Indeed, ethically, I'd say that investing in your employees should probably be OK, even if you're investing in them in very discriminatory patterns! But that's a different conversation altogether.
I respectfully disagree. As I've said, antidiscrimination law depends very heavily on the concept of disadvantage. This means scientific evidence can carry legal weight, and I've provided some. I can provide a lot more science if people request it,. howeverHowever, I'd much prefer people go off and research the topic themselves, since this is the best way to get a balanced picture of the literature.
However, I'd like to concede that you make at least one strong point here, at least implicitly. Namely, notice that there's a broader question of jurisprudence lurking beneath the surface here, namely: can so-called judge-made-law really be considered law per se, as opposed to "mere" precedent? I'm pretty sure the philosophers have yet to agree on this issue, so I concede that the way my answer is written, which proceeds 'as if' the mere-precedent side had won the debate, weakens the writing somewhat. But I also think the thrust of what I'm saying is spot on. So at some level, your point here is a good one.
Beyond this, you're right that there's a degree of speculation in the latter parts of my answer. However, however that's because the law is not clear-cut in this area, and therefore we cannot know whether such policies are ultimately going to be regarded as having been legal (at the time they existed) without speculating somewhat on what the future holds. That's just the situation we're in right now! I'd hardly call that pure-speculation speculation, and I think the tone you've chosen to use (characterized by e.g. strong words and phrase and choppy sentences) probably overstates the strength of your points.