#ifndef LIMITS_WORKAROUND #define LIMITS_WORKAROUND namespace workaround { template struct numeric_limits { static T inf() { return static_cast(0);} static T sup() { return static_cast(0);} }; template<> struct numeric_limits { static int inf() { return -2147483647; } static int sup() { return 2147483647; } }; template<> struct numeric_limits { static unsigned int inf() { return 0ul; } static unsigned int sup() { return 4294967294ul; } }; template<> struct numeric_limits { static float inf() { return -sup(); } static float sup() { float z=0.0f; return 1.0f/z; } }; template<> struct numeric_limits { static double inf() { return -sup(); } static double sup() { float z=0.0; return 1.0/z; } }; } #endif