Debounce in C++

Maybe this isn’t a good platform to ask such a question, So I posted it on StackOverflow. Still, if you can help, please check this link:
Debounce in c++
@ssjgz