contextfree / winrt-rust

Use and (eventually) make Windows Runtime APIs with Rust
Apache License 2.0
142 stars 10 forks source link

Generate parametric interface GUIDs using const fns #47

Open Boddlnagg opened 6 years ago

Boddlnagg commented 6 years ago

We're currently generating all the necessary parametric interface GUIDs ahead of time in the code generator (C#). At least those that are necessary to compile the library. User code might need additional parametric interface instantiations and there's no way for the user to get the required GUIDs. We should instead try to do this from Rust using const fns, once that is ~implemented~ stable.

The C++ WinRT projection is using constexpr to do this: https://www.youtube.com/watch?v=7TdpWB_vRZM#t=23m46s

Boddlnagg commented 5 years ago

I started working on this in a branch: https://github.com/Boddlnagg/winrt-rust/tree/constfn-pinterface

However, const fn support is not yet capable of everything that we need for it to work.