Ajust test code using 'type erasure'

http://www.cplusplus.com/articles/oz18T05o/