Let's use a template for the number type and only enable it for integral types

This way you can also use it with uint32_t int32_t, etc.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>