diff --git a/bin/meson.build b/bin/meson.build index 800bc6f..658b058 100755 --- a/bin/meson.build +++ b/bin/meson.build @@ -1,6 +1,6 @@ executable( 'hack', - 'logger/main.cpp', + 'utils/main.cpp', dependencies : deps, cpp_args: args, include_directories : inc diff --git a/bin/utils/main.cpp b/bin/utils/main.cpp index b5b53bf..b2ca409 100644 --- a/bin/utils/main.cpp +++ b/bin/utils/main.cpp @@ -1,5 +1,3 @@ -#include - #include "hack/logger/logger.hpp" #include "hack/utils/utils.hpp" #include "hack/utils/singleton.hpp" diff --git a/run b/run.sh similarity index 100% rename from run rename to run.sh diff --git a/src/hack/logger/logger.hpp b/src/hack/logger/logger.hpp index d3e6c61..7b7b009 100755 --- a/src/hack/logger/logger.hpp +++ b/src/hack/logger/logger.hpp @@ -119,7 +119,7 @@ namespace hack static void print_t(const T& data) { std::cout << "{"; - std::copy(data.cbegin(), data.cend(), iterators::associative_ostream_iterator(data.size(), std::cout)); + std::copy(data.begin(), data.cend(), iterators::associative_ostream_iterator(data.size(), std::cout)); std::cout << "}" << (count != 0 ? devider : ""); } diff --git a/src/hack/memory/make_ptr.hpp b/src/hack/memory/make_ptr.hpp index ca8ada9..1f7da50 100644 --- a/src/hack/memory/make_ptr.hpp +++ b/src/hack/memory/make_ptr.hpp @@ -17,7 +17,7 @@ namespace hack::memory template typename std::enable_if::value, std::unique_ptr>::type make_unique(std::size_t n) { - using RT = typename std::remove_extent::type; + using RT = std::remove_extent::type; return std::unique_ptr(new RT[n]); } } diff --git a/src/hack/utils/func_query.hpp b/src/hack/utils/func_query.hpp index b71b07a..477145c 100755 --- a/src/hack/utils/func_query.hpp +++ b/src/hack/utils/func_query.hpp @@ -24,6 +24,11 @@ namespace hack::utils return std::string("'") + f_str + std::string("',"); } + inline std::string make_one(char f) + { + return std::string("'") + f + std::string("',"); + } + template requires std::integral std::string make_one(First f) @@ -33,12 +38,20 @@ namespace hack::utils return std::string("'") + f_str + std::string("',"); } - inline std::string make_one(float f) + inline std::string make_one(const float f) { auto f_str = std::to_string(f); f_str = std::regex_replace(f_str, std::regex("'"), "[quote]"); - return std::string("'") + f_str + std::string("',"); + return f_str + std::string(","); } + + inline std::string make_one(int f) + { + auto f_str = std::to_string(f); + f_str = std::regex_replace(f_str, std::regex("'"), "[quote]"); + return f_str + std::string(","); + } + inline std::string make_one(JSON f) { std::string f_str = nlohmann::to_string(f); diff --git a/src/hack/utils/utils.hpp b/src/hack/utils/utils.hpp index 1ac065e..153040c 100755 --- a/src/hack/utils/utils.hpp +++ b/src/hack/utils/utils.hpp @@ -1,13 +1,13 @@ #pragma once #include -#include +#include #include -#include namespace hack::utils { - // + // HERE + // это возможно нужно все перенести по отдельным файлам для понимания и расширения template auto func_memory(Result (*f)(Args...)) {