The default implementation of this method is not very efficient at all. It uses a ostrstream object to convert x to a decimal representation in a string. Then it counts the number of characters in the string. This method should really be specialized for T, if at all possible.
Name | Type | Description |
---|---|---|
x | T | Some number. |
#include <nttl/nttlTraits.h> ... nttlTraits<int> tr; ... int x = 123; size_t s = tr.DecimalDigits( x ); |