#pragma once #include "schema.hpp" namespace saw { template struct meta_schema { static_assert(always_false, "Not supported Schema."); }; template<> struct meta_schema { using Schema = schema::Void; using MetaSchema = schema::Void; }; template<> struct meta_schema { using Schema = schema::Bool; using MetaSchema = schema::Void; }; template struct meta_schema> { using MetaSchema = schema::Void; using Schema = schema::Primitive; }; template struct meta_schema, schema::Primitive >> { using Schema = schema::MixedPrecision, schema::Primitive>; using MetaSchema = schema::Void; }; template struct meta_schema> { using MetaSchema = schema::Void; using Schema = schema::Ref; }; template struct meta_schema> { using MetaSchema = schema::Void; using Schema = schema::Map; }; template struct meta_schema...>> { using MetaSchema = schema::Struct::MetaSchema,Lit>...>; using Schema = schema::Struct...>; }; template struct meta_schema...>> { using MetaSchema = schema::Union::MetaSchema,Lit>...>; using Schema = schema::Union...>; }; template struct meta_schema> { using MetaSchema = schema::Tuple::MetaSchema...>; using Schema = schema::Tuple; }; template<> struct meta_schema { using MetaSchema = schema::UInt64; using Schema = schema::String; }; /** * Technically we also can distinguish if T is primitive. */ template struct meta_schema> { using MetaSchema = schema::FixedArray; using Schema = schema::Array; }; template struct meta_schema> { using MetaSchema = schema::Void; using Schema = schema::FixedArray; }; }