The example should have also included <limits> (that is needed for std::numeric_limits). std::midpoint comes from <numeric> which includes <limits>. This is why it works.
Technically it would break with modules, however, with modules we would #import std; and don't think about singular headers anyway. 🤷
Any chance that the header file import statement should be ‘ #include <limits>’ instead?
Good spot.
The example should have also included <limits> (that is needed for std::numeric_limits). std::midpoint comes from <numeric> which includes <limits>. This is why it works.
Technically it would break with modules, however, with modules we would #import std; and don't think about singular headers anyway. 🤷
Ahh, good to know. I was wondering why it still works.
Thanks for the tidbit!
"How hard could it be? "
😅