From aa8a352642e4ace2fc3c9bd94a09258fa7a68e47 Mon Sep 17 00:00:00 2001 From: jigarsha Date: Thu, 1 Jun 2017 18:38:16 -0700 Subject: [PATCH] Update merge_sorted_arrays.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comparator 'greater' should also include the type.
Compilation fails with the following error.
error: wrong number of template arguments (0, should be 1)
priority_queue > min_heap; Proposed change is to simply include the type. Using the following compiler version:
g++ --version;
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix --- solutions/cpp/merge_sorted_arrays.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solutions/cpp/merge_sorted_arrays.h b/solutions/cpp/merge_sorted_arrays.h index bd77ec89..04746cd1 100644 --- a/solutions/cpp/merge_sorted_arrays.h +++ b/solutions/cpp/merge_sorted_arrays.h @@ -27,7 +27,7 @@ struct IteratorCurrentAndEnd { vector MergeSortedArrays(const vector>& sorted_arrays) { priority_queue, - greater<>> + greater > min_heap; for (const vector& sorted_array : sorted_arrays) {