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

[c++2py] TRIQS/unstable - NB5 Wrapping Problem #6

Open
Wentzell opened this issue Aug 22, 2017 · 0 comments
Open

[c++2py] TRIQS/unstable - NB5 Wrapping Problem #6

Wentzell opened this issue Aug 22, 2017 · 0 comments

Comments

@Wentzell
Copy link
Member

I used an example out of cpp2py/5-Parameters.ipynb together with TRIQS/unstable.

I found that wrapping the following params class

%%triqs
​
struct params{ 
 int i;
 double x=0; 
 params(){}  // default 
};
​
double f(params const & a) {
 return a.i + a.x;   
}

and using it from the notebook​

p = Params()
p.i, p.x = 1, 2.9
print p.i
print f(p)

fails with

---------------------------------------------------------------------------TypeError
Traceback (most recent call last)
<ipython-input-5-64e6831a17a4> in <module>()
----> 1 p = Params()
      2 p.i, p.x = 1, 2.9
      3 print p.i
      4 print f(p)

TypeError: cannot create 'ext.ext.Params' instances
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

1 participant