#ifndef BUFFER_H_3234242
#define BUFFER_H_3234242
#include <iostream>
template<class T,int SIZE>
class Buffer {
private:
T v[SIZE];
int sz;
int dsz;
public:
Buffer():sz(SIZE) {}
const int size() const;
};
template<class T,int SIZE>
const int Buffer<T,SIZE>::size() const
{
return sz;
}
/*
类模板部分特化
*/
template<class T>
class Buffer<T,100> {
private:
T v[100];
int sz;
#define BUFFER_H_3234242
#include <iostream>
template<class T,int SIZE>
class Buffer {
private:
T v[SIZE];
int sz;
int dsz;
public:
Buffer():sz(SIZE) {}
const int size() const;
};
template<class T,int SIZE>
const int Buffer<T,SIZE>::size() const
{
return sz;
}
/*
类模板部分特化
*/
template<class T>
class Buffer<T,100> {
private:
T v[100];
int sz;