I just recently learnt that a member function like this:
class C
{
void memfunc() throw();
}
tells the compiler that this function would not throw any exceptions, and that this would speed up my code by a bit. Is this true because I have several classes which don't throw any sort of exception, and if I could optimize them it would be nice. However I haven't seen this being used in a lot of places so I think I might be missing something..
Secondly, could someone explain how std::numeric_limits<int>::infinity() works?
There's not much difference on adding throw() to a function declaration so it isn't much used.
I don't think integral data types have infinity but you can check it using numeric_limits<int>::has_infinity.
Infinity can be used for some calculations and can be returned from a division by zero http://www.cplusplus.com/reference/std/limits/numeric_limits/