diff --git a/bin/main.cpp b/bin/main.cpp index 7ac9f66..b77dcc3 100644 --- a/bin/main.cpp +++ b/bin/main.cpp @@ -14,11 +14,11 @@ 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; + for (const auto& c : v) hack::log()(c); } {// ex: within - std::cout << std::boolalpha << hack::range::within(12, 34, 12, 23, 31, 17, 22, 33) << std::endl; + hack::log()(hack::range::within(12, 34, 12, 23, 31, 17, 22, 33)); } {// ex: vector_multiset @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) std::vector vs { "asdf", "qwer", "zxcv" }; hack::log()("vector", vs, 1, 2, 'a'); - + std::list ls { "asdf", "qwer", "zxcv" }; hack::log()(vs, ls); @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) std::vector 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 v { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; hack::container::vector_remove_at(v, 3); diff --git a/src/logger/logger.hpp b/src/logger/logger.hpp index d6755f2..ec44a3d 100644 --- a/src/logger/logger.hpp +++ b/src/logger/logger.hpp @@ -9,23 +9,6 @@ namespace hack { - template - concept is_sequence_container = std::same_as> || - std::same_as>; - - template - concept is_tuple = requires (T t) - { - std::tuple_cat(t, std::make_tuple(1, "tuple")); - }; - - template - concept is_string = std::is_convertible_v; - - template - concept is_map = std::same_as> || - std::same_as>; - class log { public: @@ -67,7 +50,7 @@ namespace hack print(args...); } - template + template static void print_t(const T& data) { std::cout << data << (count != 0 ? devider : ""); @@ -79,7 +62,7 @@ namespace hack std::cout << data << (count != 0 ? devider : ""); } - template + template static void print_t(const T& data) { std::cout << "{ "; @@ -87,7 +70,7 @@ namespace hack std::cout << " }" << (count != 0 ? devider : ""); } - template + template static void print_t(const T& data) { std::cout << "{"; @@ -95,7 +78,7 @@ namespace hack std::cout << "}" << (count != 0 ? devider : ""); } - template + template static void print_t(const T& data) { print_t(data, std::make_index_sequence::value>{});