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

Usage of type unions #43

Open
Upabjojr opened this issue Nov 26, 2018 · 1 comment
Open

Usage of type unions #43

Upabjojr opened this issue Nov 26, 2018 · 1 comment

Comments

@Upabjojr
Copy link
Contributor

Upabjojr commented Nov 26, 2018

I have translated some parts of MatchPy into C++. I am finding difficulties implementing the type Union[TLeft, TRight]. I could use C++17 and variant<TLeft, TRight>, but this would break compatibility with older compilers.

I have translated parts of BipartiteGraph into C++ and I have temporarily used the template TEdgeValue only:
https://github.com/symengine/symengine/blob/9cb6da759fb95e2ffece407e0cf2bad136a3933b/matchpygen/bipartite.h#L29

Could the dictionary _graph be split into _graph_left and _graph_right to keep type consistency without type unions?

@hbarthels
Copy link
Contributor

Looking at the code, I would say yes.

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

No branches or pull requests

2 participants