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

Problem with c++ classes inside classes #3132

Open
foradan opened this issue Sep 6, 2019 · 2 comments

Comments

@foradan
Copy link

commented Sep 6, 2019

The code:

cimport libcpp.string
cdef libcpp.string.string.interator i

Gives the error: "'libcpp.string.string' is not a cimported module". While the code:

cimport libcpp.vector
cdef libcpp.vector.vector[int].iterator i

Compiles without error.

The above error also happens for other situations where a class inside a non-template class is used.

I am using cython version 0.29.7.

@foradan

This comment has been minimized.

Copy link
Author

commented Sep 6, 2019

The above problem can be circumvented with:

from libcpp.string cimport string
cdef string.iterator i
@foradan

This comment has been minimized.

Copy link
Author

commented Sep 6, 2019

But the circumvention doesn't work in the case of classes inside classes inside classes.

test.cxx:

class A {
    class B {
        class C {
        };
    };
};
from test cimport A
cdef A.B.C i

still fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.