Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hoytak
Copy link
Contributor

@hoytak hoytak commented Nov 19, 2015

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.

@hoytak hoytak added this to the 15-12 Update milestone Dec 3, 2015
* - flex_dict (std::vector<std::pair<flexible_type, flexible_type> >)
* - flex_date_time (boost::ptime)
////////////////////////////////////////////////////////////////////////////////

Copy link

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.

Copy link

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.

Copy link
Contributor Author

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.

Hoyt Koepke added 2 commits January 8, 2016 10:49
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.
@hoytak hoytak force-pushed the flextype-hyperconversional-squirrelishness branch from 3cf909e to e7e163b Compare January 8, 2016 19:38
@haijieg
Copy link
Contributor

haijieg commented Jan 18, 2016

jenkins pls

@ylow
Copy link

ylow commented Jan 26, 2016

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.

@hoytak
Copy link
Contributor Author

hoytak commented Feb 1, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants