This is not possible because C++ doesn't allow to return arrays from functions.
This is untrue.
It
is true. What you return in your example, is a pointer, not an array.
No, it doesnt exactly.
Ah, I see. Actually, I had exactly the same idea some time ago. I considered it quite useful to handle realtime and onetime events in a uniform way.
But I believe this is out of SFML's scope, because it's not really basic functionality. It would probably restrict the current event polling system. I don't know either how many users require this feature. Anyway, this is just my point of view, maybe Laurent communicates his opinion.
I would implement the input handler similarly to you. However, you could make the code faster (logarithmic instead of linear complexity) when you use std::set instead of std::list. But regarding the fact that there will be only a few events every frame and that dynamic allocation costs much more than a search, std::vector combined with std::find() might be the fastest. Just try and find out what's the most efficient on your compiler. But std::list is not, that's for sure.