One of my favourites in the standard library: numeric_limits. Sometimes, you want to initialize a number to something really big. Some code just uses magic numbers, but the proper way is to use numeric_limits<T>::max(), which does exactly what you expect.

Now numeric_limits<T>::infinity() is funnier. What happens when T is int?

For C++ integers, infinity is 0.

looks familiar… hope I haven’t buried bombs in my code :p

This one comes from the code we’re working on… but I think we’re safe now ðŸ™‚