diff options
-rw-r--r-- | include/inspircd.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/inspircd.h b/include/inspircd.h index 6c078b1d5..4648eaf69 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -71,6 +71,13 @@ template<typename T> inline std::string ConvToStr(const T &in) return tmp.str(); } +template<typename T> inline long ConvToInt(const T &in) +{ + std::stringstream tmp; + if (!(tmp << in)) return 0; + return atoi(tmp.str().c_str()); +} + /** This class contains various STATS counters * It is used by the InspIRCd class, which internally * has an instance of it. |