You must consider the surrounding text in which the verse appears to understand who "this generation" is. Consider the immediate context of the verse:
“Now learn this lesson from the fig tree: As soon as its twigs get tender and its leaves come out, you know that summer is near. 33 Even so, when you see all these things, you know that it[e] is near, right at the door. 34 Truly I tell you, this generation will certainly not pass away until all these things have happened. 35 Heaven and earth will pass away, but my words will never pass away. Matthew 24:32-35
You assume that "this generation" refers to whom he is immediately speaking. However, as we see above, he says this within the context of the parable of the fig tree. He says that "when you see these things" - that is when you see these signs and events which he above describes as the beginning of birth pains - that then you will "know that it is near, right at the door." And it is "THIS generation who will certainly not pass away until all these things have happened," that is to say, the generation who sees these signs.
Furthermore, the rest of the chapter goes onto describe the fact that no one knows the day nor the hour when these things will occur - not even the angels in heaven or the Son, but only the Father - only God Almighty himself. It would be quite foolhardy to say that no one knows this, not even the son - yet then try to say that the Son gave a deadline of the immediate generation.
There are false prophets who have tried to rebut that while we might not be able to pinpoint the day or the hour that we can know the week, month, year, etc. when these things will occur - but I don't think anyone can honestly read that passage and come to the conclusion that it was intended to merely restrict the precision of calculating when these things will occur. Rather the spirit of the verse is that it is beyond us to know when these things will occur until they start occurring - and even then, only if you have been persevering and keeping watch.
“Therefore keep watch, because you do not know on what day your Lord will come. 43 But understand this: If the owner of the house had known at what time of night the thief was coming, he would have kept watch and would not have let his house be broken into. 44 So you also must be ready, because the Son of Man will come at an hour when you do not expect him. Matthew 24:42-44