Record Detail

Compile Error

In file included from /in/driver/main.cpp:4:0:
/in/sort.hpp: In instantiation of 'void bubble_sort(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]':
/in/driver/main.cpp:133:45:   required from here
/in/sort.hpp:10: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: In instantiation of 'void insertion_sort(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]':
/in/driver/main.cpp:138:48:   required from here
/in/sort.hpp:22: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: In instantiation of 'void selection_sort(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]':
/in/driver/main.cpp:143:48:   required from here
/in/sort.hpp:37: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: In instantiation of 'void merge_sort(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]':
/in/driver/main.cpp:148:44:   required from here
/in/sort.hpp:102:48: error: conversion to 'int' from 'std::vector<node>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
     merge_sort_helper(vector, 0, vector.size() - 1, comp);
/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:153:50:   required from here
/in/sort.hpp:132:54: error: conversion to 'int' from 'std::vector<node>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
     quick_sort_extra_helper(vector, 0, vector.size() - 1, comp);
/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:158:52:   required from here
/in/sort.hpp:161:56: error: conversion to 'int' from 'std::vector<node>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
     quick_sort_inplace_helper(vector, 0, vector.size() - 1, comp);
/in/sort.hpp: In instantiation of 'void quick_sort_extra_helper(std::vector<T>&, int, int, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]':
/in/sort.hpp:132:28:   required from 'void quick_sort_extra(std::vector<T>&, Compare) [with T = node; Compare = bool (*)(const node&, const node&)]'
/in/driver/main.cpp:153:50:   required from here
/in/sort.hpp:126:66: error: conversion to 'int' from 'std::vector<node>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
     quick_sort_extra_helper(vector, left, left + leftPart.size() - 1, comp);
                                           ~~~~~~~~~~~~~~~~~~~~~~~^~~
/in/sort.hpp:127:62: error: conversion to 'int' from 'std::vector<node>::size_type {aka long unsigned int}' may alter its value [-Werror=conversion]
     quick_sort_extra_helper(vector, right - rightPart.size() + 1, right, comp);
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
cc1plus: all warnings being treated as errors

Information

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