2019-06-26 16:11:22 -04:00
|
|
|
#include <linked_helper.h>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int main() {
|
2020-01-23 20:49:59 -05:00
|
|
|
deque entries = {
|
|
|
|
linked::create_entry(0, 1, 0),
|
|
|
|
linked::create_entry(0, 2, 1),
|
|
|
|
linked::create_entry(0, 3, 3),
|
|
|
|
linked::create_entry(0, 4, 5),
|
|
|
|
linked::create_entry(0, 5, 3),
|
|
|
|
};
|
2019-06-26 16:11:22 -04:00
|
|
|
|
2020-01-23 20:49:59 -05:00
|
|
|
deque<string> errors;
|
|
|
|
auto head = linked::build_chain(entries, errors);
|
|
|
|
if(!errors.empty()) {
|
|
|
|
cout << "got " << errors.size() << " errors" << endl;
|
|
|
|
for(const auto& error : errors)
|
|
|
|
cout << " " << error << endl;
|
|
|
|
}
|
2019-06-26 16:11:22 -04:00
|
|
|
|
2020-01-23 20:49:59 -05:00
|
|
|
while(head) {
|
|
|
|
cout << " => " << head->entry_id << endl;
|
|
|
|
head = head->next;
|
|
|
|
}
|
2019-06-26 16:11:22 -04:00
|
|
|
|
2020-01-23 20:49:59 -05:00
|
|
|
return 0;
|
2019-06-26 16:11:22 -04:00
|
|
|
}
|