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

boost::variant limitation to 20 elements because of mpl limitations #1

Open
cppljevans opened this issue Jul 12, 2017 · 2 comments
Open

Comments

@cppljevans
Copy link

The comment here:

https://github.com/BoostGSoC17/dataframe/blob/master/include/df.cpp#L44

mentions a problem with boost::variant which may be solved by the implementation
mentioned in this thread:

https://groups.google.com/forum/#!msg/boost-developers-archive/35ghGGPePuM/4W2hlvFRDgAJ

In addition, there's another workaround that uses multiple inheritance and std::aligned_union.
(Actually, I've no looked at the method in boost-developers-archive; so, it may be
the same implementation as I was thinking of).

@cppljevans
Copy link
Author

cppljevans commented Jul 14, 2017

The variant workaround mentioned above is found here:

https://github.com/cppljevans/composite_storage/blob/master/MapAsVariant.cpp

If you study that "long enough", you might see a simpler implementation of:

allowed_inner_types Type()

HINT. Instead of:

https://github.com/cppljevans/composite_storage/blob/master/MapAsVariant.cpp#L112-#L139

add a get_at_val with the template args reversed. The get_at_val()
would return the Key at the given ValueType, and from that, you could get the needed
allowed_inner_type enumerator. WARNING: not tested.

Or, I think maybe:

https://github.com/cppljevans/composite_storage/blob/master/MapAsVariant.cpp#L108

does something similar and you might find useful.

HTH.

@RArora28
Copy link
Collaborator

Hi,
Thank you for the suggestion, I will talk to my mentor about the same.

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

No branches or pull requests

2 participants