From 2699ec7e876c560f7a7028b269ba2713c93226f0 Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 7 Mar 2019 20:37:36 +0300 Subject: [PATCH 1/2] Fix build on some libcxx implementations src/topic_partition_list.cpp:91:30: error: use of undeclared identifier 'equal'; did you mean 'std::equal'? bool match = equal(topic.begin(), topic.end(), partition.get_topic().begin(), ^~~~~ std::equal ../libs/cxxsupp/libcxx/include/algorithm:1215:1: note: 'std::equal' declared here equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) ^ 1 error generated. --- src/topic_partition_list.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/topic_partition_list.cpp b/src/topic_partition_list.cpp index 72f5cd65..8e921bcf 100644 --- a/src/topic_partition_list.cpp +++ b/src/topic_partition_list.cpp @@ -89,7 +89,7 @@ TopicPartitionList find_matches(const TopicPartitionList& partitions, for (const auto& topic : topics) { if (topic.size() == partition.get_topic().size()) { // compare both strings - bool match = equal(topic.begin(), topic.end(), partition.get_topic().begin(), + bool match = std::equal(topic.begin(), topic.end(), partition.get_topic().begin(), [](char c1, char c2)->bool { return toupper(c1) == toupper(c2); }); From 9b184d881c15cc50784b28688c7c99d3d764db24 Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 7 Mar 2019 20:55:38 +0300 Subject: [PATCH 2/2] Requested fix --- src/topic_partition_list.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/topic_partition_list.cpp b/src/topic_partition_list.cpp index 8e921bcf..67e0b8e8 100644 --- a/src/topic_partition_list.cpp +++ b/src/topic_partition_list.cpp @@ -38,6 +38,7 @@ using std::vector; using std::set; using std::ostream; using std::string; +using std::equal; namespace cppkafka { @@ -89,7 +90,7 @@ TopicPartitionList find_matches(const TopicPartitionList& partitions, for (const auto& topic : topics) { if (topic.size() == partition.get_topic().size()) { // compare both strings - bool match = std::equal(topic.begin(), topic.end(), partition.get_topic().begin(), + bool match = equal(topic.begin(), topic.end(), partition.get_topic().begin(), [](char c1, char c2)->bool { return toupper(c1) == toupper(c2); });