class Foo {
public:
static void bar();
};
I C++ you normally call that like this:
Foo::bar();
I am trying to write a small cython method which calls that method:
cdef cppclass Foo:
static void bar()
cdef bar(region_type region):
Foo::bar()
but that results in a cython compile error on the Foo::bar() statement.
Is that a bug, or is there another way to call static methods?
Wichert.
I didn't try your example, but in any case, the correct syntax for calling
a function in Python (and Cython) is using the dot notation, i.e. Foo.bar().
Stefan
thanks for the quick response.
That fixes the cython error, but the results in a C++ compilation error:
expected unqualified-id before ‘.’ token
Wichert,
Use c-name specifiers to hack around this, i.e.
cdef extern from "...":
cdef cppclass Foo:
...
cdef Foo_bar "Foo::bar""() # not declared as a memeber
- Robert