|
|
@ -204,9 +204,6 @@ namespace CppSharp.Generators.CLI |
|
|
|
|
|
|
|
|
|
|
|
var function = template.TemplatedFunction; |
|
|
|
var function = template.TemplatedFunction; |
|
|
|
|
|
|
|
|
|
|
|
var typeNames = template.Parameters.Select( |
|
|
|
|
|
|
|
param => "typename " + param.Name).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var typeCtx = new CLITypePrinterContext() |
|
|
|
var typeCtx = new CLITypePrinterContext() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Kind = TypePrinterContextKind.Template, |
|
|
|
Kind = TypePrinterContextKind.Template, |
|
|
@ -217,11 +214,20 @@ namespace CppSharp.Generators.CLI |
|
|
|
|
|
|
|
|
|
|
|
var typePrinter = new CLITypePrinter(Driver, typeCtx); |
|
|
|
var typePrinter = new CLITypePrinter(Driver, typeCtx); |
|
|
|
var retType = function.ReturnType.Type.Visit(typePrinter, |
|
|
|
var retType = function.ReturnType.Type.Visit(typePrinter, |
|
|
|
function.ReturnType.Qualifiers); |
|
|
|
function.ReturnType.Qualifiers).Split('<')[0]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var typeNamesStr = ""; |
|
|
|
|
|
|
|
var paramNamesStr = ""; |
|
|
|
|
|
|
|
var paramNames = template.Parameters.Select(param => param.Name).ToList(); |
|
|
|
|
|
|
|
if (paramNames.Any()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
typeNamesStr = "typename " + string.Join(", typename ", paramNames); |
|
|
|
|
|
|
|
paramNamesStr = string.Join(", ", paramNames); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
WriteLine("generic<{0}>", string.Join(", ", typeNames)); |
|
|
|
WriteLine("generic<{0}>", typeNamesStr); |
|
|
|
WriteLine("{0} {1}::{2}({3})", retType, QualifiedIdentifier(@class), |
|
|
|
WriteLine("{0}<{1}> {2}::{3}({4});", retType, paramNamesStr, |
|
|
|
SafeIdentifier(function.Name), |
|
|
|
QualifiedIdentifier(@class), SafeIdentifier(function.Name), |
|
|
|
GenerateParametersList(function.Parameters)); |
|
|
|
GenerateParametersList(function.Parameters)); |
|
|
|
|
|
|
|
|
|
|
|
WriteStartBraceIndent(); |
|
|
|
WriteStartBraceIndent(); |
|
|
|