CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

CList 作参数怎么定义?

楼主cqa()2002-03-14 16:38:08 在 VC/MFC / 基础类 提问

void   Test(CList   *pList)  
  {  
          ....  
  }  
   
  编译错误:  
  error   C2955:   'CList'   :    
  use   of   class   template   requires   template   argument   list 问题点数:100、回复次数:5Top

1 楼oyf888(欧阳锋)回复于 2002-03-14 16:54:45 得分 60

用void   Test(CList   &   myList)试一下,不传指针传引用Top

2 楼cqa()回复于 2002-03-14 16:57:10 得分 0

不行!一样的。Top

3 楼ATField()回复于 2002-03-14 17:19:37 得分 40

一定要具体点才行吧,   CList<TYPE1,type2>   myList  
  CList   is   a   template   class   that   takes   two   template   arguments.  
  The   first   argument   is   type   stored   internally   by   the   list,   the  
  second   argument   is   the   type   used   in   the   arguments   for   the  
  CList   methods  
  具体可参看MSDN及MFC例子COLLECT.Top

4 楼cqa()回复于 2002-03-14 17:30:08 得分 0

已经OK!  
   
   
  typedef   CList   <CTest,CTest&>   CLIST;  
   
  void   Test(CLIST   *pList)  
  {  
        ...  
  }Top

5 楼cqa()回复于 2002-03-14 17:31:09 得分 0

多谢     oyf888(欧阳锋)   和   ATField(field)   。  
  结账!Top

相关问题

  • 怎么样定义参数不定的整型参数………………
  • 为什么CList<int,int>后一个参数不定义为引用 ,而CList<CString,CString&> 要定义为引用呢
  • 在Type Library中定义的参数怎么不能定义成数组啊
  • stringreplace这个函数的最后一个参数怎么定义?
  • java中函数的缺省参数怎么定义?
  • sqlserver的存储过程numeric参数怎么定义长度啊?
  • C#怎么定义可选参数的函数?
  • ADOconnect怎么自定义,设置参数,连接数据库mssql
  • dll的输出函数(dllexport)是怎么定义参数的啊??
  • 怎么自定义一个CList类??

关键词

  • template
  • clist
  • arguments
  • plist
  • void test
  • list
  • type

得分解答快速导航

  • 帖主:cqa
  • oyf888
  • ATField

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo