This commit is contained in:
ackimixs
2024-05-22 13:06:54 +02:00
parent 581b90b035
commit 7fa6740893
3 changed files with 61 additions and 43 deletions

View File

@@ -15,7 +15,7 @@ enum ParameterType
CONST_CHAR_PTR
};
template<typename T> struct ParameterTypeTraits {};
template<typename T, typename E = void> struct ParameterTypeTraits {};
template<> struct ParameterTypeTraits<std::string> {
static constexpr ParameterType type = STRING;
@@ -56,3 +56,11 @@ template<> struct ParameterTypeTraits<char*> {
template<> struct ParameterTypeTraits<const char*> {
static constexpr ParameterType type = CONST_CHAR_PTR;
};
template<typename T> struct ParameterTypeTraits<T, std::enable_if<std::is_same_v<T, std::string>>> {
static constexpr ParameterType type = STRING;
};
template<typename T> struct ParameterTypeTraits<T, std::enable_if_t<std::is_enum_v<T>>> {
static constexpr ParameterType type = INT;
};