You can't just stash a building and cash it out 40 years later. You would have to maintain it for all that time and it's a huge liability. By the end of the day the building will be much worse than the ones being built at that time, really the only value of it will be the land is stands on. Any value in the building itself will come from recent renovations, not 40 yo investment. Thus the building is not a savings mechanism. The land may be, though.
Even then only if population continues to rise - if population drops as it does in almost all developed countries your land will be worth a lot less. Imagine a world where there are 1000 old people who can't work but own land, and then there are 100 young who can work and need a place to live. The first 100 buildings will sell/rent for some amount of food, the remaining 900 old people will die of starvation because there is nothing they can offer to the young in exchange for food.
I'm living in a building that was built in the 1920's. It is definitely still useful.
True, consumer goods generally don't last that long, but capital goods can last for a half-century or more.