Это все в заголовочном файле, и в основном все довольно просто, я объявляю список, а затем заполняю его без проблем и могу напечатать список из другой функции, которая у меня есть в заголовочном файле без проблем, но проблема идет с функцией сортировки. Он постоянно говорит, что он
Код серьезности Описание Ошибка состояния подавления строки файла проекта C2664 'bool (Bike *, Bike *)':
не может преобразовать аргумент 2 из '_Value_type' в 'Bike * 'Project7 C: \ Program Files (x86) \ Microsoft Visual Studio \ 2019 \ Community \ VC \ Tools \ MSVC \ 14.24.28314 \ include \ xutility 1481
//the argument for the sort function
bool comp_id(Bike* b1, Bike* b2)
{
return b1->id_num < b2->id_num;
}
//This is how I plan on sorting it.
// Also, side note can I do list<Bike> secondList = head; and then sort secondList.sort(comp_id)?
head.sort(comp_id);
for (auto iterator = head.begin(); iterator != head.end(); ++iterator)
{
cout << iterator->id_num << endl;
}
//This is the Structure
struct Bike
{
char manufact[25];
int id_num;
status rented_code; //RENTED/NOT_RENTED
char to_whom[25]; //to whom bike is rented
int size;
float cost_per_day;
bool deleted; //to mark bike as deleted in the list.
Bike* next_manuf; //pointer to next node in the
//manufacturers list
Bike* next_id; //pointer to the next node
//in the list by ID
Bike* next; //pointer to the next node in the general list
};