C ++ / CLI泛型编译错误

马赫尼克

我在编译此类文件时遇到问题。

卡集

#include "Card.h"
#pragma once
using namespace System;
using namespace Collections;


generic <typename  C>
public ref class CardSet<C> 
{
public:
    CardSet<C>();
};

卡集

#include "CardSet.h"

generic <typename  C>
CardSet<C>::CardSet()
{
}

在此处输入图片说明我正在关注http://www.functionx.com/cppcli/classes2/Lesson24d.htm

某人可以建议我在做什么错吗?

汉斯·帕桑特

好吧,遵循本教程演示的语法,您不会<C>在所有地方重复正确的语法是:

generic <typename C>
public ref class CardSet {
public:
    CardSet();
};

generic <typename C>
CardSet<C>::CardSet(){
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章