diff --git a/src/Generator/Utils/Utils.cs b/src/Generator/Utils/Utils.cs index e2e5b9bd..87c55e6d 100644 --- a/src/Generator/Utils/Utils.cs +++ b/src/Generator/Utils/Utils.cs @@ -207,6 +207,24 @@ namespace CppSharp } } + public static class LinqHelpers + { + public static IEnumerable WithoutLast(this IEnumerable xs) + { + T lastX = default(T); + + var first = true; + foreach (var x in xs) + { + if (first) + first = false; + else + yield return lastX; + lastX = x; + } + } + } + public static class AssemblyHelpers { public static IEnumerable FindDerivedTypes(this Assembly assembly,