Record Detail

Compile Error

In file included from /in/driver/main.cpp:4:0:
/in/sort.hpp: In instantiation of 'void merge(std::vector<T>&, int, int, int, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]':
/in/sort.hpp:116:14:   required from 'void merge_sort_helper(std::vector<T>&, int, int, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]'
/in/sort.hpp:125:22:   required from 'void merge_sort(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]'
/in/driver/main.cpp:143:44:   required from here
/in/sort.hpp:77:16: error: invalid initialization of reference of type 'const node&' from expression of type 'size_t {aka long unsigned int}'
     while (comp(a, leftVec.size()) && comp(b, rightVec.size()))
            ~~~~^~~~~~~~~~~~~~~~~~~
/in/sort.hpp:77:43: error: invalid initialization of reference of type 'const node&' from expression of type 'size_t {aka long unsigned int}'
     while (comp(a, leftVec.size()) && comp(b, rightVec.size()))
                                       ~~~~^~~~~~~~~~~~~~~~~~~~
/in/sort.hpp:94:16: error: invalid initialization of reference of type 'const node&' from expression of type 'size_t {aka long unsigned int}'
     while (comp(a, leftVec.size()))
            ~~~~^~~~~~~~~~~~~~~~~~~
/in/sort.hpp:100:16: error: invalid initialization of reference of type 'const node&' from expression of type 'size_t {aka long unsigned int}'
     while (comp(b, rightVec.size()))
            ~~~~^~~~~~~~~~~~~~~~~~~~

Information

Submit By
Type
Submission
Homework
Project 1
Language
C++
Submit At
2021-10-18 06:18:33
Judged At
2021-10-18 06:18:33
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes