Why Zserio templates are not implemented by C++ templates? #444
Locked
mikir
announced in
Design Notes
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The main problem why Zserio templates are not implemented by C++ templates are primitives types which can be used as template parameters.
Consider the following easy Zserio template code:
If template parameter is a primitive Zserio type (
uint8
,string
,bool
), there is no way how to deduce corresponded write and read methods from them. For example, primitive typesuint16
andvaruin16
have the same C++ mapping touint16_t
type but different coding to the bit stream. Therefore for each possible primitive type, there would have to be a corresponded class wrapper available in the runtime library, e.g.UInt8TemplateParameter
,BoolTemplateParameter
, etc..Beta Was this translation helpful? Give feedback.
All reactions