Why does the STL not contain an unbounded integer data type?
I feel like it’s a data type whose purpose is similar to that of a string.
Programmers would not have to worry about overflowing values and could work with much larger numbers.
So I’m curious if there is a specific reason for it’s absence.
This isn’t an issue on how to implement or use one from a 3rd party library,
but just a question as to why the language doesn’t already come with one.
Any links on the matter are appreciated.
You probably mean arbitrary precision arithmetic or big numbers.
Perhaps it is not in C++ because it is not relevant to a wide audience. Very probably, almost any non-trivial C++ code would use some part of the STL (
std::ostreamor collections likestd::vectoror types likestd::string).But a lot of code don’t need big numbers.
Likewise, graphical interfaces (like Qt) are not a part of STL, for the same reasons. A lot of people don’t care about these issues (e.g. in server code, or numerical applications).
And defining a standard library is a big effort. In my opinion, C++ STL is perhaps too big already; no need to add a lot more inside.
You might want to use GMP if you need it.