I would suggest that this is described in the C ++ standard, but I could not find it. I am writing some patterns that are going to do arithmetic according to their non-piggy integral parameters, and I believe that I need an equivalent MAX_INTfor the parameter "x" in a pattern such as template <int x> Foo.
Ideally, someone can point me to a paragraph in the standard (if one exists) that gives valid ranges for the sizes of the integral parameters of the template and any way to determine the actual number of bits for a particular implementation.
- Page To clarify: its templates that will do the math in the type system, as part of the metaprogramming library. An "int" will never be created, and will never be used for storage at run time. In many ways this is similar to the math performed by the preprocessor, and in this case I know that integral types do not guarantee the same size as "int". What I'm looking for is part of a standard that says ARE types are the same or not, and if not, how many bits are used by the template's integral parameters at compile time.
source
share