c++实例研究

从0开始

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  104 随笔 :: 0 文章 :: 20 评论 :: 0 Trackbacks
#include <iostream>
#include 
<vector>
#include 
<algorithm>
using namespace std;

template 
<typename T, template<typename E> class Container>
struct Foo
{
    
public:
        T data;
        Container
<T> cont;
}
;

int main()
{
    Foo
<int,vector> f;
    f.data 
= 9;
    f.cont.push_back(
9);
    
return 0;
}

posted on 2010-10-02 11:48 elprup 阅读(149) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理