|
|
@ -1,4 +1,5 @@ |
|
|
|
using System.Linq; |
|
|
|
using System; |
|
|
|
|
|
|
|
using System.Linq; |
|
|
|
using CppSharp.AST; |
|
|
|
using CppSharp.AST; |
|
|
|
using CppSharp.AST.Extensions; |
|
|
|
using CppSharp.AST.Extensions; |
|
|
|
|
|
|
|
|
|
|
@ -17,9 +18,9 @@ namespace CppSharp.Passes |
|
|
|
if (@class.Specializations.Count == 0) |
|
|
|
if (@class.Specializations.Count == 0) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Func<TemplateArgument, bool> allPointers = a => a.Type.Type != null && a.Type.Type.IsAddress(); |
|
|
|
var groups = (from specialization in @class.Specializations |
|
|
|
var groups = (from specialization in @class.Specializations |
|
|
|
group specialization by specialization.Arguments.All( |
|
|
|
group specialization by specialization.Arguments.All(allPointers) into @group |
|
|
|
a => a.Type.Type != null && a.Type.Type.IsAddress()) into @group |
|
|
|
|
|
|
|
select @group).ToList(); |
|
|
|
select @group).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var group in groups.Where(g => g.Key)) |
|
|
|
foreach (var group in groups.Where(g => g.Key)) |
|
|
@ -27,7 +28,8 @@ namespace CppSharp.Passes |
|
|
|
@class.Specializations.Remove(specialization); |
|
|
|
@class.Specializations.Remove(specialization); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = @class.Specializations.Count - 1; i >= 0; i--) |
|
|
|
for (int i = @class.Specializations.Count - 1; i >= 0; i--) |
|
|
|
if (@class.Specializations[i] is ClassTemplatePartialSpecialization) |
|
|
|
if (@class.Specializations[i] is ClassTemplatePartialSpecialization && |
|
|
|
|
|
|
|
!@class.Specializations[i].Arguments.All(allPointers)) |
|
|
|
@class.Specializations.RemoveAt(i); |
|
|
|
@class.Specializations.RemoveAt(i); |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|