#include "hamming.h" #include #include #include #include namespace hamming { using namespace std; int compute(const char *cstr1, const char *cstr2) { const string str1(cstr1); const string str2(cstr2); if (str1.size() != str2.size()) throw domain_error("Strings have different length"); return inner_product(str1.begin(), str1.end(), str2.begin(), 0, plus(), not_equal_to()); } }