Change constexpr function pointers to static constants

Note: Newer version of gcc no longer supports constexpr
function pointers to be declared in the header file.
Therefore we fixed this by declaring them as static
constants in the header file and moved the initialization
to the source file.

Change-Id: Ied87c62b14be79cc268cfe8c63e8f2385c7e75b6
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/mainloop.cpp b/mainloop.cpp
index b639539..399b17e 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -25,6 +25,35 @@
 #include "env.hpp"
 #include "thresholds.hpp"
 
+// Initialization for Warning Objects
+decltype(Thresholds<WarningObject>::setLo) Thresholds<WarningObject>::setLo =
+    &WarningObject::warningLow;
+decltype(Thresholds<WarningObject>::setHi) Thresholds<WarningObject>::setHi =
+    &WarningObject::warningHigh;
+decltype(Thresholds<WarningObject>::getLo) Thresholds<WarningObject>::getLo =
+    &WarningObject::warningLow;
+decltype(Thresholds<WarningObject>::getHi) Thresholds<WarningObject>::getHi =
+    &WarningObject::warningHigh;
+decltype(Thresholds<WarningObject>::alarmLo) Thresholds<WarningObject>::alarmLo =
+    &WarningObject::warningAlarmLow;
+decltype(Thresholds<WarningObject>::alarmHi) Thresholds<WarningObject>::alarmHi =
+    &WarningObject::warningAlarmHigh;
+
+// Initialization for Critical Objects
+decltype(Thresholds<CriticalObject>::setLo) Thresholds<CriticalObject>::setLo =
+    &CriticalObject::criticalLow;
+decltype(Thresholds<CriticalObject>::setHi) Thresholds<CriticalObject>::setHi =
+    &CriticalObject::criticalHigh;
+decltype(Thresholds<CriticalObject>::getLo) Thresholds<CriticalObject>::getLo =
+    &CriticalObject::criticalLow;
+decltype(Thresholds<CriticalObject>::getHi) Thresholds<CriticalObject>::getHi =
+    &CriticalObject::criticalHigh;
+decltype(Thresholds<CriticalObject>::alarmLo) Thresholds<CriticalObject>::alarmLo =
+    &CriticalObject::criticalAlarmLow;
+decltype(Thresholds<CriticalObject>::alarmHi) Thresholds<CriticalObject>::alarmHi =
+    &CriticalObject::criticalAlarmHigh;
+
+
 using namespace std::literals::chrono_literals;
 
 static constexpr auto typeAttrMap =
diff --git a/thresholds.hpp b/thresholds.hpp
index 6f7bef2..d0b7f0b 100644
--- a/thresholds.hpp
+++ b/thresholds.hpp
@@ -21,18 +21,12 @@
     static constexpr InterfaceType type = InterfaceType::WARN;
     static constexpr const char* envLo = "WARNLO";
     static constexpr const char* envHi = "WARNHI";
-    static constexpr int64_t (WarningObject::*setLo)(int64_t) =
-        &WarningObject::warningLow;
-    static constexpr int64_t (WarningObject::*setHi)(int64_t) =
-        &WarningObject::warningHigh;
-    static constexpr int64_t (WarningObject::*getLo)() const =
-        &WarningObject::warningLow;
-    static constexpr int64_t (WarningObject::*getHi)() const =
-        &WarningObject::warningHigh;
-    static constexpr bool (WarningObject::*alarmLo)(bool) =
-        &WarningObject::warningAlarmLow;
-    static constexpr bool (WarningObject::*alarmHi)(bool) =
-        &WarningObject::warningAlarmHigh;
+    static int64_t (WarningObject::*const setLo)(int64_t);
+    static int64_t (WarningObject::*const setHi)(int64_t);
+    static int64_t (WarningObject::*const getLo)() const;
+    static int64_t (WarningObject::*const getHi)() const;
+    static bool (WarningObject::*const alarmLo)(bool);
+    static bool (WarningObject::*const alarmHi)(bool);
 };
 
 /**@brief Thresholds specialization for critical thresholds. */
@@ -42,18 +36,12 @@
     static constexpr InterfaceType type = InterfaceType::CRIT;
     static constexpr const char* envLo = "CRITLO";
     static constexpr const char* envHi = "CRITHI";
-    static constexpr int64_t (CriticalObject::*setLo)(int64_t) =
-        &CriticalObject::criticalLow;
-    static constexpr int64_t (CriticalObject::*setHi)(int64_t) =
-        &CriticalObject::criticalHigh;
-    static constexpr int64_t (CriticalObject::*getLo)() const =
-        &CriticalObject::criticalLow;
-    static constexpr int64_t (CriticalObject::*getHi)() const =
-        &CriticalObject::criticalHigh;
-    static constexpr bool (CriticalObject::*alarmLo)(bool) =
-        &CriticalObject::criticalAlarmLow;
-    static constexpr bool (CriticalObject::*alarmHi)(bool) =
-        &CriticalObject::criticalAlarmHigh;
+    static int64_t (CriticalObject::*const setLo)(int64_t);
+    static int64_t (CriticalObject::*const setHi)(int64_t);
+    static int64_t (CriticalObject::*const getLo)() const;
+    static int64_t (CriticalObject::*const getHi)() const;
+    static bool (CriticalObject::*const alarmLo)(bool);
+    static bool (CriticalObject::*const alarmHi)(bool);
 };
 
 /** @brief checkThresholds