]> git.lyx.org Git - lyx.git/blobdiff - src/support/lstrings.h
* lyxfunctional.h: delete compare_memfun and helper classes
[lyx.git] / src / support / lstrings.h
index f70d140b5a8f6336d17a83dcd046072820167de4..7d371266e327ac143cb1e26b10b4c78841c0b018 100644 (file)
@@ -97,23 +97,11 @@ bool suffixIs(std::string const &, char);
 bool suffixIs(std::string const &, std::string const &);
 
 ///
-bool contains(std::string const & a, std::string const & b);
-
-///
-bool contains(std::string const & a, char b);
-
-/// This should probably we rewritten to be more general.
-class contains_functor {
-public:
-       typedef std::string first_argument_type;
-       typedef std::string second_argument_type;
-       typedef bool result_type;
-
-       bool operator()(std::string const & haystack, std::string const & needle) const {
-               return contains(haystack, needle);
-       }
-};
-
+template <typename B>
+bool contains(std::string const & a, B b)
+{
+       return a.find(b) != std::string::npos;
+}
 
 ///
 bool containsOnly(std::string const &, std::string const &);