Problem with checkisnan

Not sure that cmake stores strings correctly in cache. This leads to issues when trying to store
ISNAN_VARIATION. Moved to implementation with two variables: ISNAN_VARIATION and ISNAN_HEADERS.
Makes it possible to define a function rather than a macro.
Adding begin/end functions of c++11