For a couple of years maybe 4-5 that's my point, are ryzen cpus capable of gaming and tasking.
The point we are making is thats an impossible to give an exact answer question. What is "tasking"? The dual core pentium gold in my Surface Go can "task" all day long.
You want something that can crush the newest games, have a bunch of browsers open, and record you while you're doing it? Sure the Ryzen 7 3950X can do that, and probably for a long time. Want to just game and stream? Sure the 3700X can do that no problem. Gaming only, or other software? 3600X, will crush it now, and probably last.
You should buy a CPU based on what you need it for, and in theory it should do that for a good amount of time. Its been a very long time since the higher end of AMD's CPUs were poor choices. Nowadays you can't go wrong with either brand, but AMD eeks out Intel in value based on the number of cores you get for the price.
As for what any of them will do in 5 years? Most likely they will still do the job just as well. Not as good as the newest ones, but won't be poor either. Plenty of people here still gaming on 5 year old CPUs perfectly fine except for a few games. The current trend is more cores, so we can guess it will continue that way, as software catches up. No way to predict where the technology will go, we can only speculate, hence nothing is ever "future proof".