mirror of
https://github.com/getml/sqlgen.git
synced 2026-01-05 09:00:10 -06:00
21 lines
397 B
C++
21 lines
397 B
C++
#ifndef SQLGEN_INTERNAL_TO_STR_HPP_
|
|
#define SQLGEN_INTERNAL_TO_STR_HPP_
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <type_traits>
|
|
|
|
#include "../parsing/Parser.hpp"
|
|
|
|
namespace sqlgen::internal {
|
|
|
|
template <class T>
|
|
std::optional<std::string> to_str(const T& _val) {
|
|
using Type = std::remove_cvref_t<T>;
|
|
return parsing::Parser<Type>::write(_val);
|
|
}
|
|
|
|
} // namespace sqlgen::internal
|
|
|
|
#endif
|