首页 > 代码库 > Template template parameter(模板參数) example

Template template parameter(模板參数) example

/********************************************************************************* 
 Copyright (C), 1988-1999, drvivermonkey. Co., Ltd. 
 File name:  
 Author: Driver Monkey 
 Version:  
 Mail:bookworepeng@hotmail.com 
 Date: 2014.04.02 
 Description:  
 *********************************************************************************/ 
#include<stdlib.h>
#include <iostream>
#include <typeinfo>
#include <typeindex> 
#include <map>

using namespace std;

class A
{
	public:
    A(){cout<<"A created!"<<endl;}
};

template<class T>
class creat_t
{
	public:
    creat_t(){cout<<"A::"<<typeid(T).name()<<endl;}
};

template<template<class T>  class creat_t>
class sub_creat_t:public creat_t<float>
{
	public:
    sub_creat_t(){cout<<"sub_creat_t created!"<<endl;}
};


int main(int argc, char** argv) {
    sub_creat_t<creat_t> temp;

    return 0;
}

Template template parameter(模板參数) example