I need to implement almost the same function, but for different sizes. In particular, it is something like ...
type& operator=(unsigned int); type& operator=(unsigned long int); type& operator=(unsigned long long int); type& operator=(int); type& operator=(long int); type& operator=(long long int); type& operator=(short int);
They should do the same ... (except that I have to consider different sizes), the main idea would be that "if the type is the most extensive use of code for the task ... otherwise cast and execute code. " Is it possible to eliminate all such duplicate code using only one method? (I just don't want the compiler to give me a warning when compiling ...).
thanks
source share