Browse Source

Decreased the number of needed template internals in the C# end.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/658/head
Dimitar Dobrev 10 years ago
parent
commit
26d908b2f3
  1. 5
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

5
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -77,7 +77,7 @@ namespace CppSharp.Generators.CSharp
{ {
if (!nested && if (!nested &&
specialization.TemplatedDecl.TemplatedClass.Fields.All( specialization.TemplatedDecl.TemplatedClass.Fields.All(
f => !f.IsDependent || f.Type.IsAddress())) f => !(f.Type.Desugar() is TemplateParameterType)))
return string.Empty; return string.Empty;
if (specialization.Arguments.All( if (specialization.Arguments.All(
@ -338,7 +338,8 @@ namespace CppSharp.Generators.CSharp
private void GenerateClassTemplateSpecializationInternal(ClassTemplate classTemplate) private void GenerateClassTemplateSpecializationInternal(ClassTemplate classTemplate)
{ {
IList<ClassTemplateSpecialization> specializations; IList<ClassTemplateSpecialization> specializations;
if (classTemplate.TemplatedClass.Fields.Any(f => f.IsDependent && !f.Type.IsAddress())) if (classTemplate.TemplatedClass.Fields.Any(
f => f.Type.Desugar() is TemplateParameterType))
specializations = classTemplate.Specializations; specializations = classTemplate.Specializations;
else else
specializations = new[] { classTemplate.Specializations[0] }; specializations = new[] { classTemplate.Specializations[0] };

Loading…
Cancel
Save