Applying transition when calling popScene

Hello. I wonder if there is a way to apply a transition when i’m calling popScene? I found some code in Objective-C http://www.cocos2d-iphone.org/forum/topic/1076 Is someone has ported it to c++? How it could be ported without using templates(obvious method)?

I wrote solution

refer

http://www.cocos2d-x.org/projects/cocos2d-x/boards/6