---
# System prepended metadata

title: 模板

---

# 模板
```
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
template<class T>
int size(T a)
{
    return sizeof(a);
}

int main()
{
    double a;
    int b;

    cout << size(a) << endl;
    cout << size(b) << endl;
}
```