President Harry Truman, in 1945. (Library of Congress Prints and Photographs Division)

What would the world look like today if Harry Truman or Dwight Eisenhower had shared the foreign policy inclinations of Barack Obama or, far more dangerous, Donald Trump?

Obama has presided over an experiment in withdrawal from the Middle East, a region that the United States had long considered vital. Trump would accelerate the withdrawal, and make it global, because “we’re a poor country now,” as he told The Post’s editorial board last week.

Circumstances have forced Obama to undo or reverse aspects of his experiment, but at one point it included pulling all U.S. troops from Iraq, with plans to do the same in Afghanistan; abandoning Libya after intervening to depose its dictator; tepid support for the democracy movement that emerged in the Arab Spring; and a refusal to help those fighting Syrian dictator Bashar al-Assad, whose overthrow Obama said he favored.

Obama designed this policy because he was convinced, as Atlantic magazine national correspondent Jeffrey Goldberg put it following hours of conversation with the president, “that the Middle East could not be fixed — not on his watch, and not for a generation to come.”

The nations of the region, in other words, are unlikely to become democratic or economically successful. U.S. resources can be better spent on what Obama has called “nation-building at home” and on more important relationships in Asia. War-weary U.S. voters oppose keeping our troops in the region.

Now imagine if Truman had applied similar tests at the end of World War II. After that devastating conflict, Americans were far more war-weary than they were when Obama became president. Plenty of them believed it was time to come home, leaving Europe and Japan to deal with their own problems, including the Soviet threat. History offered little basis to hope that Japan or Germany could become reliably democratic. The United States was far poorer than it is today.

Yet Truman kept U.S. troops in both Germany and Japan — a deployment that persists after seven decades, to only occasional complaint from U.S. voters. Congress and the president devoted millions of taxpayer dollars to rebuilding both countries. They committed to a years-long occupation that imposed democratic institutions.

When the Korean War ended in 1953, it seemed even more outlandish to imagine that South Korea could one day become an important trading partner and ally of the United States, let alone a vibrant democracy. Yet Eisenhower and Congress kept U.S. troops there, too, a deployment that persists six decades later, again with little domestic objection.

We know how these stories unfolded. Democracies flourished in soils that experts insisted would be inhospitable to them. Europe and East Asia joined North America in prosperous modernity, which in turn helped the United States grow richer; median family income in this country rose from about $27,000 in 1945 to more than $62,000 today, in dollars adjusted for inflation. The continued presence of U.S. forces helped preserve an unprecedented era of peace in Europe and East Asia.

By contrast, the consequences of Obama’s retrenchment have been disastrous. A tenuous stability in Iraq gave way to renewed sectarian warfare and the emergence of a vicious terrorist state. Syria disintegrated in fighting that has killed hundreds of thousands, displaced millions, sparked what the United States has officially termed a genocide and, thanks to terrorism and refugee flows, threatens the stability of the entire European continent. Libya, just across the Mediterranean Sea from Italy, is in chaos, too, with a new Islamic State outpost putting down roots there.

Of course, every situation is different. Germany is not Korea is not Iraq. There is no guarantee that a steadying U.S. presence and long-term commitment would have delivered a better outcome. But it’s hard to imagine how things could be worse — with perhaps the most telling proof being Obama’s reluctant redeployment of 5,000 troops to Iraq, and thousands of airstrikes in Iraq and Syria.

The most perverse consequence of the disaster may be how it bolsters Trump’s isolationist message. If things are such a mess, doesn’t that prove we should just give up and come home?

The temptation to withdraw has never been far below the surface of U.S. politics. Americans have been complaining for decades that allies haven’t been paying their fair share. U.S. partners often have seemed no more deserving of our help than Mideast nations do today, and the United States has had rip-roaring fights with all of them — over trade with Japanese, missile deployments with Germans, human rights with South Koreans. Always Americans asked, understandably, why we were spending money overseas that we could be spending here at home.

But always there were politicians who would take up the hard work of making the case for U.S. leadership, beginning with presidents such as Truman and Kennedy, Reagan and Clinton. That’s a tradition that stands in danger today.

Read more from Fred Hiatt’s archive, follow him on Twitter or subscribe to his updates on Facebook.