diff options
Diffstat (limited to 'modules/codec')
-rw-r--r-- | modules/codec/c++/csv.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/codec/c++/csv.h b/modules/codec/c++/csv.h index 3727829..f40376f 100644 --- a/modules/codec/c++/csv.h +++ b/modules/codec/c++/csv.h @@ -12,10 +12,10 @@ struct Csv {}; namespace impl { template<typename Schema, typename FromDecode> struct csv_encode { - static_assert(always_false<T>, "Case not supported"); + static_assert(always_false<Schema, FromDecode>, "Case not supported"); }; -template<typename T, size_t Dim> +template<typename T, size_t Dim, typename FromDecode> struct csv_encode<schema::Array<T,Dim>, FromDecode> { static_assert(Dim == 1, "Only one dimension is allowed."); static_assert(!is_array<T>::value, "Array of an array is not allowed."); @@ -42,13 +42,23 @@ struct csv_encode<schema::Array<T,Dim>, FromDecode> { } }; -template<> +template<typename FromDecode> struct csv_encode<schema::String, FromDecode> { using Schema = schema::String; static error_or<void> encode(const data<Schema, FromDecode>& from, data<Schema, encode::Csv>& to){ - return void_t{}; + return make_error<err::not_implemented>(); + } +}; + +template<class T, size_t N, typename FromDecode> +struct csv_encode<schema::Primitive<T,N>, FromDecode> { + using Schema = schema::Primitive<T,N>; + + static error_or<void> encode(const data<Schema, FromDecode>& from, data<Schema, encode::Csv>& to){ + + return make_error<err::not_implemented>(); } }; } |