1+ using System ;
2+ using System . Runtime . CompilerServices ;
3+ using StructLinq . Select ;
4+
5+ // ReSharper disable once CheckNamespace
6+ namespace StructLinq
7+ {
8+ public static partial class StructEnumerable
9+ {
10+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
11+ public static RefSelectCollection < TIn , TOut , TEnumerable , TEnumerator , TFunction > Select < TIn , TOut , TEnumerable , TEnumerator , TFunction > (
12+ this TEnumerable enumerable ,
13+ ref TFunction function ,
14+ Func < TEnumerable , IRefStructCollection < TIn , TEnumerator > > _ ,
15+ Func < TFunction , IInFunction < TIn , TOut > > __ )
16+ where TEnumerator : struct , IRefStructEnumerator < TIn >
17+ where TFunction : struct , IInFunction < TIn , TOut >
18+ where TEnumerable : struct , IRefStructCollection < TIn , TEnumerator >
19+ {
20+ return new RefSelectCollection < TIn , TOut , TEnumerable , TEnumerator , TFunction > ( ref function , ref enumerable ) ;
21+ }
22+
23+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
24+ public static RefSelectCollection < TIn , TOut , TEnumerable , TEnumerator , StructInFunction < TIn , TOut > > Select < TIn , TOut , TEnumerable , TEnumerator > (
25+ this TEnumerable enumerable ,
26+ InFunc < TIn , TOut > function ,
27+ Func < TEnumerable , IRefStructCollection < TIn , TEnumerator > > _ )
28+ where TEnumerator : struct , IRefStructEnumerator < TIn >
29+ where TEnumerable : struct , IRefStructCollection < TIn , TEnumerator >
30+ {
31+ var fct = function . ToStruct ( ) ;
32+ return new RefSelectCollection < TIn , TOut , TEnumerable , TEnumerator , StructInFunction < TIn , TOut > > ( ref fct , ref enumerable ) ;
33+ }
34+
35+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
36+ public static RefSelectCollection < TIn , TOut , IRefStructCollection < TIn , TEnumerator > , TEnumerator , StructInFunction < TIn , TOut > > Select < TIn , TOut , TEnumerator > (
37+ this IRefStructCollection < TIn , TEnumerator > enumerable ,
38+ InFunc < TIn , TOut > function )
39+ where TEnumerator : struct , IRefStructEnumerator < TIn >
40+ {
41+ var fct = function . ToStruct ( ) ;
42+ return new RefSelectCollection < TIn , TOut , IRefStructCollection < TIn , TEnumerator > , TEnumerator , StructInFunction < TIn , TOut > > ( ref fct , ref enumerable ) ;
43+ }
44+ }
45+ }
0 commit comments