Find out the number of digits of min/max values of an integral type at compile time
Posted
by Checkers
on Stack Overflow
See other posts from Stack Overflow
or by Checkers
Published on 2010-03-04T22:50:22Z
Indexed on
2010/05/15
20:04 UTC
Read the original article
Hit count: 185
Is there a way to find out the number of digits of min/max values of an integral type at compile time so that it's suitable to be placed as a template parameter?
Ideally, there will be an existing solution in, for example, Boost MPL. Failing that I'm looking for some pointers for a hand-coded solution.
© Stack Overflow or respective owner