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

[WIP, don't merge] Non-type parameters in cxxt #383

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

Conversation

barche
Copy link

@barche barche commented May 15, 2018

The following currently doesn't work:

cxx"""
           template<typename T, int R, int C=5>
           struct LikeEigen { T val = 5.0; };
"""
const LikeEigen{T,R} = cxxt"LikeEigen<$T,$(Val{R})>"

This example seems to work with the changes in this PR, but adding a calculation on the defaulted parameter (as is done in the Eigen lib) fails:

cxx"""
           template<typename T, int R, int C=5+R>
           struct LikeEigen2 { T val = 5.0; };
"""
const LikeEigen2{T,R} = cxxt"LikeEigen2<$T,$(Val{R})>"

This PR is mostly for reference, maybe it goes in the right direction but I don't really know what I'm doing here. It is also not urgent.

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

Successfully merging this pull request may close these issues.

1 participant