add char in query

This commit is contained in:
Andrey Zimin
2024-04-15 10:39:00 +03:00
parent ad2c54649d
commit 77bcf570b4
7 changed files with 21 additions and 10 deletions

View File

@@ -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<typename T::value_type>(data.size(), std::cout));
std::copy(data.begin(), data.cend(), iterators::associative_ostream_iterator<typename T::value_type>(data.size(), std::cout));
std::cout << "}" << (count != 0 ? devider : "");
}

View File

@@ -17,7 +17,7 @@ namespace hack::memory
template <typename T>
typename std::enable_if<std::is_array<T>::value, std::unique_ptr<T>>::type make_unique(std::size_t n)
{
using RT = typename std::remove_extent<T>::type;
using RT = std::remove_extent<T>::type;
return std::unique_ptr<T>(new RT[n]);
}
}

View File

@@ -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<typename First>
requires std::integral<First>
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);

View File

@@ -1,13 +1,13 @@
#pragma once
#include <map>
#include <functional>
#include <array>
#include <memory>
#include <string>
namespace hack::utils
{
//
// HERE
// это возможно нужно все перенести по отдельным файлам для понимания и расширения
template<typename Result, typename... Args>
auto func_memory(Result (*f)(Args...))
{