This code is taken from
 http://thbecker.net/free_software_utilities/type_erasure_for_cpp_iterators/start_page.html
