Implementation of an arithmetic type in C++