Template-Based Classes 的使用方法:CList<int, int> m_intList;
m_intList.AddTail(36);
m_intList.RemoveAll();CTypedPtrList<CObList,CStroke*> m_strokeList;
CStroke* pStrokeItem = new CStroke(20);
m_strokeList.AddTail(pStrokeItem);看《深入浅出MFC》的第八章“Document-View 深入探讨”时,遇到了两个问题:
1.Collection Classes是什么?中文一般翻译成什么?各类别为什么有template/nontemplate版本区分?
2.为什么说选择template版本就可以是type-safe的?

解决方案 »

  1.   

    Collection Classes是容器类?说错了不要B4我
      

  2.   

    to Viconia():当然不会啊,谢谢!请大家踊跃发言...
    collection classes是不是容器类呢?
    容器类的作用是什么呢?
      

  3.   

    collection classes就是容器类,是用c++ template技术实现的。容器,不就是用来装其它的东西的嘛。就是数据结构中常用数据结构的封装罢了
      

  4.   

    是不是把各种类型(int、char等等)公用的数据结构进行封装,不必每一种类型写一个,这样理解对吗?
      

  5.   

    容器类就好比是数组、stack、vector之类的东东啦