Make TypeHandler far more usable #4749
Replies: 3 comments
-
I think that similar approach could also be used with |
Beta Was this translation helpful? Give feedback.
-
@matejk this is different because it's statically typed; Dynamic::Var allows for dynamic datatypes discovery and binding, but the flexibility comes with a performance price |
Beta Was this translation helpful? Give feedback.
-
@aleks-f: Sorry for not being clear. I was more referring to having partial specialisations for a group of types (like integers, enums, floats) instead of having specialisations for each type separately in |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
The way
Typehandler
is designed makes it very hard to add customTypeHandler
s that cover similar classes, or more specifically enums withstd::enable_if
.Describe the solution you'd like
Add a second template parameter to Typehandler:
This should not break any existing code, since the parameter is new and has a default.
Describe alternatives you've considered
I do not think that there are alternatives, but i would be glad to be told that i am wrong :)
Additional context
Adding the second parameter enables creating a
TypeHandler
that works for all enums:Adding that
TypeHandler
directly to poco might not be a good idea, but with the second template argument consumers of Poco can decide to do it on their own.Beta Was this translation helpful? Give feedback.
All reactions