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

Cpp: Support generic parameters #467

Merged
merged 2 commits into from
Aug 20, 2021
Merged

Cpp: Support generic parameters #467

merged 2 commits into from
Aug 20, 2021

Conversation

cmnrd
Copy link
Collaborator

@cmnrd cmnrd commented Aug 19, 2021

Type parameters could be used as types for reactor reactor parameters as is shown in the following example:

reactor<T> (bar:T(0)) {
}

However, this is currently not properly supported by the C++ generator and it produces invalid code. This PR slightly modifies the generator, so that it produces correct code for generic parameters. This PR also adds a new test case.

cmnrd added 2 commits August 19, 2021 15:14
Effectively this adds the 'typename' keyword in multiple places throughout
the generated code. This is a requirement of C++ if the types in a type trait
depend on template arguments. This is one of the many peculiarities of C++ ...
@cmnrd cmnrd added compiler cpp Related to C++ target labels Aug 19, 2021
@cmnrd cmnrd added this to the 0.1.0 Beta milestone Aug 19, 2021
@cmnrd cmnrd requested review from lhstrh and HugoForrat August 19, 2021 13:30
@cmnrd cmnrd added the enhancement Enhancement of existing feature label Aug 19, 2021
@cmnrd cmnrd merged commit 51161b2 into master Aug 20, 2021
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀🚀

@cmnrd cmnrd deleted the cpp-generic-parameter branch August 20, 2021 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler cpp Related to C++ target enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants