Comments (5)
Hmm. On second look I think it may be necessary to use concrete types that encapsulate the pointer.
https://gist.github.com/ihnorton/e694b87a86ee19e4f75a#file-ptrdispatch2-jl
Might be a performance hit, but don't worry about that for now.
from clang.jl.
Reading the friendly manual more closely gives a solution (Methods, bottom). Make the pointer type a method parameter and this plan should work perfectly:
https://gist.github.com/ihnorton/e694b87a86ee19e4f75a#file-ptrdispatch3-jl
from clang.jl.
Here is a hacky but potentially tractable idea to simulate multiple inheritance: use Union of pointer types.
https://gist.github.com/ihnorton/e694b87a86ee19e4f75a#file-ptrdispatch4-jl
(The problem here is that it requires listing each possible subclass in the Union. However, this might be best anyway because it could allow correct thunking)
from clang.jl.
Closed in 692e9ed0
from clang.jl.
Here is an idea how to support basic C++ multiple inheritance with multiple-dispatch
class A
class B
class M < { A,B }
in julia
define M <: A
all A meth(A, ...) apply as usual
define M_b <: M
implement aliases for all B functions, which do the thunk and call meth(B, ...)
from clang.jl.
Related Issues (20)
- Error when parsing alignas(64) HOT 3
- Various non-valid Julia code output HOT 8
- MIOpen generator fails HOT 4
- Support `_Atomic` HOT 2
- Support variable array function parameters
- C_LONG_LONG and C_INT64_T represented as Clong HOT 4
- `__restrict not defined` Error HOT 3
- Edge cases encountered while generating bindings for Hwloc HOT 1
- Enumerations with a fixed underlying type, via typedef HOT 1
- Bug introduced in Clang.jl v0.16.6 HOT 10
- Definitions of function pointer types should appear before their first use HOT 4
- Creating bindings for libwinit HOT 11
- size_t wrongly translated to Cint HOT 2
- Feature Request: implement `smart_deanonymize` for cenums HOT 1
- Using `fieldnames` (and similar) for wrapped C `union`s HOT 2
- Unexpected assertion error: ERROR: AssertionError: length(child_nodes) == length(fields) HOT 1
- Support for `using` HOT 3
- generating julia wrapper for C library
- Unknown CXCursorKind with Julia master/Clang.jl master HOT 2
- Unhandle type c"CXType_Int128": __int128 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clang.jl.