Remove lambda expressions as unsuppoerted by GCC 4.4
authorJohannes Schanda <schanda@itestra.de>
Wed, 16 Oct 2013 11:34:45 +0000 (13:34 +0200)
committerJohannes Schanda <schanda@itestra.de>
Wed, 16 Oct 2013 11:34:45 +0000 (13:34 +0200)
src/CommonAPI/utils.h

index 7717103..2dccfcc 100644 (file)
@@ -109,6 +109,10 @@ inline void trim(std::string& toTrim) {
     );
 }
 
+inline bool notIsdigit(char c) {
+    return !std::isdigit(c);
+}
+
 /**
  * \brief Checks whether the given string contains nothing but digits.
  *
@@ -120,13 +124,15 @@ inline bool containsOnlyDigits(const std::string& toCheck) {
     auto firstNonDigitIt = std::find_if(
                     toCheck.begin(),
                     toCheck.end(),
-                    [](char c) {
-                        return !std::isdigit(c);
-                    });
+                    notIsdigit);
 
     return firstNonDigitIt == toCheck.end();
 }
 
+inline bool notIsalnum(char c) {
+    return !std::isalnum(c);
+}
+
 /**
  * \brief Checks whether the given string contains nothing but alphanumeric characters.
  *
@@ -138,9 +144,7 @@ inline bool containsOnlyAlphanumericCharacters(const std::string& toCheck) {
     auto firstNonAlphanumericCharacterIt = std::find_if(
                     toCheck.begin(),
                     toCheck.end(),
-                    [](char c) {
-                        return !std::isalnum(c);
-                    });
+                    notIsalnum);
 
     return firstNonAlphanumericCharacterIt == toCheck.end();
 }