C ++ / CLI:如何将模板数组声明为方法参数 [英] C++/CLI : How to declare template array as method parameters

查看:123
本文介绍了C ++ / CLI:如何将模板数组声明为方法参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是C ++ / CLI的新手。对于头文件和源文件,在托管C ++ / CLI中相当于下面的C#代码?

I am a newbie to C++/CLI. What is the equivalent of the following C# code in managed C++/CLI for both the header and source file?

public static bool ArrayEquals<T>(T[] a, T[] b) 
{
    return true;
}


推荐答案

源文件:

public:
  generic <typename T>
  static bool ArrayEquals(array<T>^ a, array<T>^ b)
  {
      return true;
  }

这篇关于C ++ / CLI:如何将模板数组声明为方法参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆