Using C++ templates to avoid casting
Using C++ templates to avoid casting