/********************************************************************************* Copyright (C), 1988-1999, drvivermonkey. Co., Ltd. File name: Author: Driver Monkey Version: Mail:[email protected] 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
时间: 2024-10-11 22:11:16