|
52 | 52 | namespace fable {
|
53 | 53 | namespace schema {
|
54 | 54 |
|
55 |
| -template <typename T, typename P> |
56 |
| -Vector<T, P>::Vector(std::vector<T>* ptr, std::string desc) |
57 |
| - : Vector<T, P>(ptr, make_prototype<T>(), std::move(desc)) {} |
58 |
| - |
59 |
| -template <typename T, typename S> |
60 |
| -Vector<T, decltype(make_prototype<T>())> make_schema(std::vector<T>* ptr, S&& desc) { |
61 |
| - return Vector<T, decltype(make_prototype<T>())>(ptr, std::forward<S>(desc)); |
62 |
| -} |
63 |
| - |
64 |
| -template <typename T, size_t N, typename P> |
65 |
| -Array<T, N, P>::Array(std::array<T, N>* ptr, std::string desc) |
66 |
| - : Array<T, N, P>(ptr, make_prototype<T>(), std::move(desc)) {} |
67 |
| - |
68 |
| -template <typename T, size_t N, typename S> |
69 |
| -Array<T, N, decltype(make_prototype<T>())> make_schema(std::array<T, N>* ptr, S&& desc) { |
70 |
| - return Array<T, N, decltype(make_prototype<T>())>(ptr, std::forward<S>(desc)); |
71 |
| -} |
72 |
| - |
73 |
| -template <typename T, typename P> |
74 |
| -Const<T, P>::Const(T constant, std::string desc) |
75 |
| - : Const<T, P>(constant, make_prototype<T>(), std::move(desc)) {} |
76 |
| - |
77 |
| -template <typename T, typename S> |
78 |
| -Const<T, decltype(make_prototype<T>())> make_const_schema(T&& constant, S&& desc) { |
79 |
| - return Const<T, decltype(make_prototype<T>())>(std::forward<T>(constant), std::forward<S>(desc)); |
80 |
| -} |
81 |
| - |
82 |
| -template <typename T, typename P> |
83 |
| -Map<T, P>::Map(std::map<std::string, T>* ptr, std::string desc) |
84 |
| - : Map<T, P>(ptr, make_prototype<T>(), std::move(desc)) {} |
85 |
| - |
86 |
| -template <typename T, typename S> |
87 |
| -Map<T, decltype(make_prototype<T>())> make_schema(std::map<std::string, T>* ptr, |
88 |
| - S&& desc) { |
89 |
| - return Map<T, decltype(make_prototype<T>())>(ptr, std::forward<S>(desc)); |
90 |
| -} |
91 |
| - |
92 |
| -template <typename T, typename P> |
93 |
| -Optional<T, P>::Optional(T* ptr, std::string desc) |
94 |
| - : Optional<T, P>(ptr, make_prototype<typename T::value_type>(), std::move(desc)) {} |
95 |
| - |
96 |
| -template <typename T, typename S, std::enable_if_t<is_optional_v<T>, bool> = true> |
97 |
| -Optional<T, decltype(make_prototype<typename T::value_type>())> make_schema(T* ptr, S&& desc) { |
98 |
| - return Optional<T, decltype(make_prototype<typename T::value_type>())>(ptr, std::forward<S>(desc)); |
99 |
| -} |
100 |
| - |
101 | 55 | template <typename T, typename S, std::enable_if_t<std::is_base_of_v<Confable, T>, int>>
|
102 | 56 | auto make_prototype(S&& desc) {
|
103 | 57 | return FromConfable<T>(std::forward<S>(desc));
|
|
0 commit comments