Here is an example:
a.h
------
template<typename T>
class A
{
public:
class B
{};
};
class C
{
public:
class B
{};
};
test.pyx
---------
cdef extern from "a.h":
cdef cppclass A[T]:
cppclass B:
pass
cdef cppclass C:
cpplcass B:
pass
def main():
cdef A[int].B a_b # ok
cdef C.B c_b # error: 'C' is not a cimported module
I thought the way of accessing the name of nested class was using '.'
compared to c++'s '::', and the 'C.B' above was interpreted as getting
attribute of a module.
Or am I doing something wrong here?
Looks like a bug (or not implemented feature) in C++ support.
http://trac.cython.org/cython_trac/ticket/659
- Robert
On Sat, Jul 11, 2015 at 6:55 AM, <klo...@gmail.com> wrote:
> I just ran into this problem. Looks like the bug has not been fixed yet. Any
> suggested workarounds?
Are you trying to do something different than
https://github.com/cython/cython/blob/master/tests/run/cpp_nested_classes.pyx
?
cimport cpp_nested_classes_support
cdef cpp_nested_classes_support.A.B bfrom cpp_nested_classes_support cimport A
cdef A.B b