2025-01-03 10:58:50 +03:00
|
|
|
#include <vector>
|
|
|
|
#include <forward_list>
|
2025-01-03 11:53:18 +03:00
|
|
|
|
|
|
|
#include "hack/logger/logger.hpp"
|
2025-01-03 10:58:50 +03:00
|
|
|
|
|
|
|
#include "hack/mt/algorithms/sort.hpp"
|
|
|
|
#include "hack/mt/algorithms/max.hpp"
|
2025-01-03 10:25:22 +03:00
|
|
|
|
|
|
|
#include "hack/patterns/ring_buffer.hpp"
|
|
|
|
|
|
|
|
auto main(int argc, char *argv[]) -> int
|
2025-01-03 10:58:50 +03:00
|
|
|
{
|
|
|
|
// patterns::ring_buffer
|
|
|
|
{
|
2025-01-04 11:44:42 +03:00
|
|
|
hack::patterns::ring_buffer<int> rb(10);
|
2025-01-03 10:58:50 +03:00
|
|
|
for (int i = 1; i < 12; ++i) rb.put(i);
|
2025-01-03 11:53:18 +03:00
|
|
|
hack::log()(rb);
|
2025-01-03 10:58:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// mt::sort
|
|
|
|
{
|
|
|
|
std::vector<int> v { 4, 4, 6, 1, 4, 3, 2 };
|
|
|
|
std::forward_list<int> l { 8, 7, 5, 9, 0, 1, 3, 2, 6, 4 };
|
|
|
|
|
|
|
|
hack::mt::algorithms::sort(v);
|
|
|
|
hack::mt::algorithms::sort(l);
|
|
|
|
|
2025-01-03 11:53:18 +03:00
|
|
|
hack::log()(v);
|
|
|
|
hack::log()(l);
|
2025-01-03 10:58:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// mt::max
|
|
|
|
{
|
|
|
|
int a = 4, b = 5;
|
|
|
|
int& c = a;
|
2025-01-03 11:53:18 +03:00
|
|
|
hack::log()(hack::mt::algorithms::max(4, 5));
|
|
|
|
hack::log()(hack::mt::algorithms::max(c, b));
|
2025-01-03 10:58:50 +03:00
|
|
|
}
|
2025-01-04 11:41:10 +03:00
|
|
|
|
|
|
|
hack::error()("asdfJK");
|
2025-01-03 10:25:22 +03:00
|
|
|
}
|