add new examples
This commit is contained in:
40
bin/containers/main.cpp
Normal file
40
bin/containers/main.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <set>
|
||||
|
||||
#include "hack/logger/logger.hpp"
|
||||
#include "hack/containers/containers.hpp"
|
||||
|
||||
auto main(int argc, char *argv[]) -> int
|
||||
{
|
||||
hack::log()("============================================================");
|
||||
hack::log()("container::vector_multiset");
|
||||
|
||||
{// ex: containers::vector
|
||||
std::vector<std::string> v;
|
||||
hack::containers::vector::multiset(v, "asdf", "qwer", "zcv");
|
||||
hack::log()(v);
|
||||
|
||||
hack::containers::vector::remove_at(v, 1);
|
||||
hack::log()(v);
|
||||
|
||||
hack::containers::vector::multiset(v, "aa", "bb", "cc");
|
||||
hack::log()(v);
|
||||
|
||||
auto it = std::find(v.begin(), v.end(), "aa");
|
||||
hack::log()(*it);
|
||||
hack::containers::vector::remove_at(v, it);
|
||||
hack::log()(v);
|
||||
}
|
||||
|
||||
{// ex: containers::utils::count
|
||||
std::vector<std::string> v { "aa", "bb", "cc" };
|
||||
auto r = hack::containers::utils::count(v, "aa", "bb");
|
||||
hack::log()(r);
|
||||
}
|
||||
|
||||
{// ex: containers::set
|
||||
std::set<int> s;
|
||||
hack::containers::set::multiset(s, 1, 2, 3);
|
||||
hack::warn()("TODO: реализовать в log вывод set контейнера!");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user