stable_sort(cont, MemberCompare<typename Container::value_type, T>(mp));
}
+template<typename Container, typename Predicate>
+inline void transform(Container &cont, Predicate pred)
+{
+ transform(cont.begin(), cont.end(), cont.begin(), pred);
+}
+
} // namespace Msp
#endif
-#include <algorithm>
#include <list>
#include <stdexcept>
#include <cctype>
+#include <msp/core/algorithm.h>
#include "utils.h"
using namespace std;
string tolower(const string &str)
{
string result(str);
- transform(result.begin(), result.end(), result.begin(), [](char c){ return std::tolower(c); });
+ transform(result, [](char c){ return std::tolower(c); });
return result;
}
string toupper(const string &str)
{
string result(str);
- transform(result.begin(), result.end(), result.begin(), [](char c){ return std::toupper(c); });
+ transform(result, [](char c){ return std::toupper(c); });
return result;
}