Acceptance of gay marriage has long been a matter of when, rather than if -- in large part thanks to younger generations being overwhelmingly in favor.

But just how quickly are views of homosexuality changing from generation to generation? A new poll from the Public Religion Research Institute has some insights.

The poll tested how millennials (ages 18 to 34) view various sexual behaviors, including homosexuality. And about equal numbers say homosexuality is morally wrong (38 percent) and morally acceptable (42 percent). Another 13 percent say it depends on the situation, while 7 percent declined to answer.

What's most interesting, though, is when you compare homosexual activity to other behaviors tested. The poll shows more millennials think that sex between two people of the same gender is more acceptable than say casual sex between two people with no intention of forming a relationship (37 percent) -- though the difference is within the margin of error. And about the same number say having a child out of wedlock is acceptable (40 percent).

About twice as many young people, meanwhile, say homosexual behavior is morally acceptable as say the same about having an abortion (21 percent) and about sex between minors (24 percent).

Clearly, views of the morality of homosexuality have a major impact on acceptance of gay marriage -- though we would submit that many people who morally object to it nonetheless support gay marriage.

That homosexuality is viewed as being as or more acceptable than all of these things shows how quickly the paradigm has shifted on these issues.