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

Attributes for generating query delegetes? #33

Open
Shadowblitz16 opened this issue Oct 22, 2023 · 3 comments
Open

Attributes for generating query delegetes? #33

Shadowblitz16 opened this issue Oct 22, 2023 · 3 comments
Labels
question Further information is requested

Comments

@Shadowblitz16
Copy link

Is it possible we can get a way to generate [n] number of generic delegates on our side?

For example a game engine might want to wrap 3rd party libraries and hand writing [n] number of signatures to simply wrap something is really awful.

This is kinda why C# needs variadic generics, and typedef but sadly it does not.

@genaray
Copy link
Owner

genaray commented Oct 22, 2023

What exactly do you mean? Could you give samples? ^^

@Shadowblitz16
Copy link
Author

like generating things like...

public delegate Query<T1> QueryDelegate<T1>();
public delegate Query<T1, T2> QueryDelegate<T1, T2>();
... n more times inside our own namespace.

In C++ if we wanted to forward things into our own engine namespaces we would just typedef it and statically link the library.

C# has no such feature so in order for me to write a wrapper or forward this api into my own namespace I would need to write a lot of boiler plate.

@genaray
Copy link
Owner

genaray commented Oct 25, 2023

like generating things like...

public delegate Query<T1> QueryDelegate<T1>();
public delegate Query<T1, T2> QueryDelegate<T1, T2>();
... n more times inside our own namespace.

In C++ if we wanted to forward things into our own engine namespaces we would just typedef it and statically link the library.

C# has no such feature so in order for me to write a wrapper or forward this api into my own namespace I would need to write a lot of boiler plate.

Unfortunately that is not possible yet... you can however write your own source-generator to generate them ^^

@genaray genaray added the question Further information is requested label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants