From 9d9973eb62cbde297038afd42128ddea06815027 Mon Sep 17 00:00:00 2001 From: triton Date: Thu, 10 Oct 2013 16:16:04 +0100 Subject: [PATCH] Fixes to the C# implementation of std::vector interop. --- src/Generator/Types/Std/Stdlib.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Generator/Types/Std/Stdlib.cs b/src/Generator/Types/Std/Stdlib.cs index cf6b144d..2fe99a20 100644 --- a/src/Generator/Types/Std/Stdlib.cs +++ b/src/Generator/Types/Std/Stdlib.cs @@ -194,10 +194,7 @@ namespace CppSharp.Types.Std public override void CSharpMarshalToNative(MarshalContext ctx) { - var templateType = Type as TemplateSpecializationType; - var type = templateType.Arguments[0].Type; - - ctx.Return.Write("Std.Vector.Create({0})", ctx.Parameter.Name); + ctx.Return.Write("{0}.Internal", ctx.Parameter.Name); } public override void CSharpMarshalToManaged(MarshalContext ctx) @@ -205,7 +202,7 @@ namespace CppSharp.Types.Std var templateType = Type as TemplateSpecializationType; var type = templateType.Arguments[0].Type; - ctx.Return.Write("Std.Vector.Create<{0}>({1})", type, + ctx.Return.Write("new Std.Vector<{0}>({1})", type, ctx.ReturnVarName); } }