At the Conservative Political Action Conference (CPAC) last month, Ted Cruz responded to a question about marijuana legalization in Colorado by endorsing a federalist approach to the issue. "I actually think this is a great embodiment of what Supreme Court Justice Louis Brandeis called 'the laboratories of democracy,'" the Texas senator said. "If the citizens of Colorado decide they want to go down that road, that's their prerogative. I personally don't agree with it, but that's their right."

Those remarks seemed to contradict the position Cruz had taken a year before, when he criticized the Obama administration for failing to aggressively enforce the federal ban on marijuana in states that have legalized the drug for medical or recreational use. Speaking at a Texas Public Policy Foundation conference in January 2014, he described the Justice Department's prosecutorial restraint, which is designed to respect state policy choices, as an abuse of executive power.

Cruz's apparent turnaround reflects a political reality that he and other candidates for the Republican presidential nomination will have to confront. Although most members of their party still support pot prohibition, most Americans don't, and even within the GOP the staunchest drug warriors are dying off, while Republicans in their 20s and 30s strongly favor legalization. As with gay marriage, Republican politicians face a generational shift that will leave them struggling to placate social conservatives without alienating younger, more tolerant voters. Cruz's calibration—I don't personally favor legalization, but as a conservative constitutionalist I think the issue should be left to the states—is the easiest way to strike that balance.

Cruz is not the only presidential contender to figure that out. At the same conference where Cruz endorsed marijuana federalism, former Florida governor Jeb Bush said something similar. Former Texas governor Rick Perry, who describes himself as "a staunch promoter of the 10th Amendment," agrees. Not surprisingly, so does Rand Paul, the most libertarian Republican contemplating a presidential run.

New Jersey Gov. Chris Christie, a former U.S. attorney who opposed the legalization of medical marijuana in his state, seems less inclined to respect the 10th Amendment. During a trip to New Hampshire last June, Christie was asked, "If you were president, how would you treat states that have legalized marijuana?" His response: "Probably not well. Not well, but we'll see. We'll have to see what happens."

Christie's answer, which treats state autonomy as a favor dispensed by a generous president rather than a constitutional requirement, is inconsistent with federalism, a principle that many Republicans seem to take seriously. After Colorado and Washington voters approved marijuana legalization in 2012, a CBS News survey found that only 27 percent of Republicans agreed with that policy. Yet 65 percent of Republicans thought "laws regarding whether the use of marijuana is legal or not should be…left to each individual state government to decide."

Marijuana federalism also appeals to Republicans who support legalization, and there are more of those than there used to be, although they still represent a minority. According to surveys conducted last year, roughly a third of Republicans think pot should be legal. But the proportion is dramatically higher among young Republicans. A Pew Research Center survey conducted in February 2014 found that 63 percent of Republicans born between 1981 and 1996 favored legalization.

The outlook for Republican prohibitionists seems even bleaker when you look at survey data for the general population. Several recent surveys, including Pew's, the Gallup Poll and the General Social Survey, indicate that most Americans favor legalization. Last year's General Social Survey put support for legalization at 52 percent, nine points higher than in 2012. It seems likely that the upward trend will continue, since support is inversely associated with age. According to Gallup's 2013 results, Americans 65 and older were the only age group in which a majority still opposed legalization.

"It's clear that voter support for legalization is increasing," says Tom Angell, chairman of Marijuana Majority. "That's especially true among young voters, and a huge majority of millennials support legalization regardless of party ID. Even if some candidates aren't willing to endorse legalization outright, expressing openness to letting states set their own marijuana laws without federal interference is a way to appeal to this growing voter bloc without necessarily offending the shrinking segment of older voters who still aren't ready to abandon prohibition in their own states."

Since marijuana legalization will be on state ballots next year and will continue to be a source of friction with the federal government, the candidates who have not taken a position yet probably will be pressed to do so as the 2016 presidential campaign heats up. If they are smart, they will parrot Cruz, Perry, Bush, and Paul. Marijuana federalism is a rare opportunity for politicians to be prudent, principled, and popular.

This article originally appeared at Forbes.com.