blob: 866bc7e443ecdb03afd03e8b86a6d8b075a6f92f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#pragma once
#include "schema.hpp"
namespace kel {
namespace lbm {
namespace impl {
template<class T>
struct schema_to_string_helper {
static_assert(always_false<T>, "schema_to_string_helper specialization not handled.");
static constexpr string_literal apply(){
return {};
}
};
template<>
struct schema_to_string_helper<sch::SignedInteger> final {
static constexpr string_literal apply(){
return "SignedInteger";
}
};
template<>
struct schema_to_string_helper<sch::UnsignedInteger> final {
static constexpr string_literal apply(){
return "UnsignedInteger";
}
};
template<>
struct schema_to_string_helper<sch::FloatingPoint> final {
static constexpr string_literal apply(){
return "FloatingPoint";
}
};
template<typename T, uint64_t N>
struct schema_to_string_helper<sch::Primitive<T,N>> final {
static constexpr string_literal apply(){
return "Primitive<"+schema_to_string_helper<T>::apply()+","+N+">";
}
};
}
template<class T>
struct schema_to_string{
static constexpr std::string_view value = impl::schema_to_string_helper<T>::apply().view();
};
}
}
|