Record Detail

Compile Error

In file included from /in/driver/main.cpp:4:0:
/in/sort.hpp: In instantiation of '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:121:9: error: conversion to 'int' from 'std::vector<node>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
     int n = vector.size();
         ^
/in/sort.hpp:119:69: error: unused parameter 'comp' [-Werror=unused-parameter]
 void merge_sort(std::vector<T> &vector, Compare comp = std::less<T>()) {
                                                                     ^
/in/sort.hpp: In instantiation of 'void quick_sort_extra(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]':
/in/driver/main.cpp:147:50:   required from here
/in/sort.hpp:168:9: error: conversion to 'int' from 'std::vector<node>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
     int n = vector.size();
         ^
/in/sort.hpp:166:75: error: unused parameter 'comp' [-Werror=unused-parameter]
 void quick_sort_extra(std::vector<T> &vector, Compare comp = std::less<T>()) {
                                                                           ^
/in/sort.hpp: In instantiation of 'void quick_sort_inplace(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]':
/in/driver/main.cpp:151:52:   required from here
/in/sort.hpp:207:18: error: conversion to 'unsigned int' from 'std::vector<node>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
     unsigned int n = vector.size();
                  ^
/in/sort.hpp:205:77: error: unused parameter 'comp' [-Werror=unused-parameter]
 void quick_sort_inplace(std::vector<T> &vector, Compare comp = std::less<T>()) {
                                                                             ^
/in/sort.hpp: In instantiation of 'void quick_sort_extra_helper(std::vector<T>&, int, int) [with T = node]':
/in/sort.hpp:170:28:   required from 'void quick_sort_extra(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]'
/in/driver/main.cpp:147:50:   required from here
/in/sort.hpp:131:27: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for (int i = 0; i < B.size(); i++)
/in/sort.hpp:141:27: error: no match for 'operator<' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<node> >::value_type {aka node}' and 'node')
             if (vector[i] < pivot)
                 ~~~~~~~~~~^~~~~~~
/in/sort.hpp: In instantiation of 'void merge(std::vector<T>&, int, int, int) [with T = node]':
/in/sort.hpp:114:14:   required from 'void merge_sort_helper(std::vector<T>&, int, int) [with T = node]'
/in/sort.hpp:123: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:63:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (int i = 0; i < leftVec.size(); i++)
/in/sort.hpp:68:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (int j = 0; j < rightVec.size(); j++)
/in/sort.hpp:75:14: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     while (a < leftVec.size() && b < rightVec.size())
/in/sort.hpp:75:36: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     while (a < leftVec.size() && b < rightVec.size())
/in/sort.hpp:78:24: error: no match for 'operator<=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<node> >::value_type {aka node}' and '__gnu_cxx::__alloc_traits<std::allocator<node> >::value_type {aka node}')
         if (leftVec[a] <= rightVec[b])
             ~~~~~~~~~~~^~~~~~~~~~~~
/in/sort.hpp:92:14: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     while (a < leftVec.size())
/in/sort.hpp:98:14: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     while (b < rightVec.size())
/in/sort.hpp: In instantiation of 'int partition(std::vector<T>&, int, int) [with T = node]':
/in/sort.hpp:198:32:   required from 'void quick_sort_inplace_helper(std::vector<T>&, int, int) [with T = node]'
/in/sort.hpp:209:30:   required from 'void quick_sort_inplace(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]'
/in/driver/main.cpp:151:52:   required from here
/in/sort.hpp:182:40: error: no match for 'operator<=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<node> >::value_type {aka node}' and 'node')
         while (i <= right && vector[i] <= pivot) i++;
                              ~~~~~~~~~~^~~~~~~~
/in/sort.hpp:183:45: error: no match for 'operator>=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<node> >::value_type {aka node}' and 'node')
         while ((left + 1) <= j && vector[j] >= pivot) j--;
                                   ~~~~~~~~~~^~~~~~~~
cc1plus: all warnings being treated as errors

Information

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