1#include <boost/algorithm/string/predicate.hpp>
2
3// works with const char*
4assert(boost::algorithm::ends_with("mystring", "ing"));
5
6// also works with std::string
7std::string haystack("mystring");
8std::string needle("ing");
9assert(boost::algorithm::ends_with(haystack, needle));
10
11std::string haystack2("ng");
12assert(! boost::algorithm::ends_with(haystack2, needle));
13