add vector_remove_at
This commit is contained in:
54
bin/main.cpp
54
bin/main.cpp
@@ -1,6 +1,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "string/string.hpp"
|
||||
@@ -10,27 +11,27 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// {// ex: split_str
|
||||
// std::string str { "asdf,qwer,zxcv" };
|
||||
// hack::string::v_str v = hack::string::split_str(str, ',');
|
||||
// for (const auto& c : v) std::cout << c << std::endl;
|
||||
// }
|
||||
//
|
||||
// {// ex: within
|
||||
// std::cout << std::boolalpha << hack::range::within(12, 34, 12, 23, 31, 17, 22, 33) << std::endl;
|
||||
// }
|
||||
//
|
||||
// {// ex: v_multiset
|
||||
// std::vector<std::string> v;
|
||||
// hack::container::v_multiset(v, "asdf", "qwer", "zcv");
|
||||
// for(const auto& c : v) std::cout << c << std::endl;
|
||||
// }
|
||||
//
|
||||
// {// ex: s_multiset
|
||||
// std::set<int> s;
|
||||
// hack::container::s_multiset(s, 1, 2, 3, 3, 2, 1);
|
||||
// for(const auto& c : s) std::cout << c << std::endl;
|
||||
// }
|
||||
{// ex: split_str
|
||||
std::string str { "asdf,qwer,zxcv" };
|
||||
hack::string::v_str v = hack::string::split_str(str, ',');
|
||||
for (const auto& c : v) std::cout << c << std::endl;
|
||||
}
|
||||
|
||||
{// ex: within
|
||||
std::cout << std::boolalpha << hack::range::within(12, 34, 12, 23, 31, 17, 22, 33) << std::endl;
|
||||
}
|
||||
|
||||
{// ex: vector_multiset
|
||||
std::vector<std::string> v;
|
||||
hack::container::vector_multiset(v, "asdf", "qwer", "zcv");
|
||||
for(const auto& c : v) std::cout << c << std::endl;
|
||||
}
|
||||
|
||||
{// ex: set_multiset
|
||||
std::set<int> s;
|
||||
hack::container::set_multiset(s, 1, 2, 3, 3, 2, 1);
|
||||
for(const auto& c : s) std::cout << c << std::endl;
|
||||
}
|
||||
|
||||
{// ex: log
|
||||
hack::log()(1234, "run in main", 1234);
|
||||
@@ -52,4 +53,15 @@ int main(int argc, char *argv[])
|
||||
std::tuple<int, std::string, bool> tp { 1, "tuple test", false };
|
||||
hack::log()(tp);
|
||||
}
|
||||
|
||||
{// ex: matches
|
||||
std::vector<int> v { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
hack::log()(hack::container::matches(v, 2, 5, 4, 12));
|
||||
}
|
||||
|
||||
{// ex: vector_remove_at
|
||||
std::vector<int> v { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
hack::container::vector_remove_at(v, 3);
|
||||
hack::log()(v);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user