-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite of flexible type converter logic. #93
base: master
Are you sure you want to change the base?
Rewrite of flexible type converter logic. #93
Conversation
* - flex_dict (std::vector<std::pair<flexible_type, flexible_type> >) | ||
* - flex_date_time (boost::ptime) | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should prioritize exact type matches before the remaining cases since those have fast paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For instance flex_list, flex_vec and flex_dict have faster conversion paths than the otherwise implied path below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that's true... These would use the v1.assign(v2.begin(), v2.end())
methods instead of v1 = v2
, which should be exactly the same for identical matches of vector types. I can add it these cases for clarity, but I think it's already as fast as possible.
Rewrote the flexible type converter logic to be much more readible and flexible. This is the next stage of the flexible type improvements. The logic used a different metaprogramming method documented in flexible_type_converter.hpp. This gives much better control over error messages and better flexibility in adding additional types. Also discovered and fixed some minor bugs with the gl_string classes.
3cf909e
to
e7e163b
Compare
jenkins pls |
Looks about right, but you want to add fast paths for direct matches to flexible_type types. i.e. if the passed type is exactly a flex_dict for instance, you want it to execute a single copy and no go through the longer path. There is a template function: is_valid_flex_type::value (see flexible_type_base_types.hpp) for a compile time check if T matches one of the flexible_type base types. |
Currently, it appears this is causing issues with the variant type stuff in some cases, so I'm investigating that when I have time. It's not highest priority at the moment. |
Rewrote the flexible type converter logic to be much more readible and
flexible. This is the next stage of the flexible type improvements.
The logic used a different metaprogramming method documented in
flexible_type_converter.hpp. This gives much better control over
error messages and better flexibility in adding additional types.
Also discovered and fixed some minor bugs with the gl_string classes.