You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-20Lines changed: 17 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,15 @@ It aims to make allocation-free, specialized Linq queries per your type.
12
12
Install from NuGet, both [LinqGen](https://www.nuget.org/packages/LinqGen) as library and [LinqGen.Generator](https://www.nuget.org/packages/LinqGen.Generator) as source generator.
@@ -79,7 +81,7 @@ The `LinqGen` assembly contains a stub method and types, which helps you autocom
79
81
After you write a Linq query with stub methods, then `LinqGen.Generator` runs and replace the stub methods with generated methods.
80
82
81
83
How is it possible, while modifying user code is not allowed with source generators?
82
-
It's because everything `LinqGen.Generator` generates designed to be precede over stub methods on [overload resolution](https://learn.microsoft.com/en-us/dotnet/visual-basic/reference/language-specification/overload-resolution).
84
+
It's because everything `LinqGen.Generator` generates designed to be precede over stub methods on [overload resolution](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/expressions#11782-method-invocations).
83
85
84
86
## Does LinqGen works with Unity Burst compiler?
85
87
@@ -100,8 +102,8 @@ public struct LinqGenSampleJob : IJob
100
102
intindex=0;
101
103
102
104
foreach (variteminInput.Specialize()
103
-
.Select(newSelector())
104
-
.OrderBy(newComparer()))
105
+
.Select(newSelector())
106
+
.Order(newComparer()))
105
107
{
106
108
Output[index++] =item;
107
109
}
@@ -119,9 +121,6 @@ public struct Comparer : IComparer<int>
119
121
}
120
122
```
121
123
122
-
### Current limitation with Burst (to-be-fixed)
123
-
* Only `NativeArray<T>` and `NativeSlice<T>` is supported for struct enumeration.
124
-
125
124
## Supported methods (working-in-progress)
126
125
### Generations
127
126
* Empty
@@ -131,24 +130,21 @@ public struct Comparer : IComparer<int>
131
130
### Operations
132
131
* Select
133
132
* Where
134
-
* Cast
135
-
* OfType
136
-
* Skip
137
-
* Take
133
+
* Cast, OfType
134
+
* Skip, Take
138
135
* Distinct
139
-
* OrderBy, OrderByDescending
136
+
*Order, OrderBy, OrderByDescending
140
137
* ThenBy, ThenByDescending
138
+
* GroupBy
141
139
142
140
### Evaluations
143
-
* First
144
-
* FirstOrDefault
145
-
* Last
146
-
* LastOrDefault
141
+
* ToArray, ToList
142
+
* First, FirstOrDefault
143
+
* Last, LastOrDefault
147
144
* Count
148
145
* Sum
149
146
* Supports duck typing with `+` operator overload
150
-
* Min
151
-
* Max
147
+
* Min, Max
152
148
153
149
### Etc
154
150
* Specialize
@@ -158,6 +154,7 @@ public struct Comparer : IComparer<int>
158
154
159
155
## Limitations
160
156
* Element or key types that used with LinqGen must have at least `internal` accessibility.
157
+
* Struct enumerable should implement `IStructEnumerable<,>` interface.
161
158
* LinqGen queries should be treated as anonymous type, it cannot be used as return value or instance member. If you have these needs, use `AsEnumerable()` to convert.
162
159
* LinqGen may not work well when `[InternalsVisibleTo]` is used while both assemblies are using LinqGen. It can be solved when [this language feature](https://github.com/dotnet/csharplang/issues/6794) is implemented.
0 commit comments