Skip to content

Conversation

@Eregerog
Copy link
Contributor

@Eregerog Eregerog commented Jun 9, 2019

Implemented a nice deconstructor extension method for KeyValuePairs, which makes the following code possible:

foreach(var (key, value) in myDict) // ...

This is in a preprocessor directive, since the feature has no use before c#7. It would still compile, but probably just confuse people.

TODO for XDracam:

  • Add a short mention in the Documentation, you can use a more fancy version of my example
  • Check the preprocessor directive. I didn't get #if NET47 to work, so i had to use the UnityVersion one

@XDracam XDracam added the c#7 C#7 only feature label Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c#7 C#7 only feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants