##将模板用作参数template<template <typename T> class Thing>
实例
也可以写成template<template <typename T> typename Thing>
// stacktp.h -- a stack template
//stacktp.h文件,用数组实现一个栈
#include"pch.h"
template <class Type>
class Stack
{
private:
enum {
MAX = 10}; // constant specific to class
Type items[MAX]; // holds stack items
int top; // index for top stack item
public:
Stack();
bool isempty();
bool isfull();
bool push(const Type & item); // add item to stack
bool pop(Type & item); // pop top into item
};
template <class Type>
Stack<Type>::Stack(