---
title: "C++教程59  函数模板"
author: "yuanyu5237"
date: "2014-07-03T15:07:10Z"
tags: []
categories: ["编程语言"]
slug: "c-59"
draft: false
lastmod: "2014-07-03T15:07:44Z"
id: 2087954
url: "https://yuandingping.iteye.com/blog/2087954"
---

```
#include <iostream>
using namespace std;

template <class FIRST, class SECOND>
FIRST smaller(FIRST a, SECOND b)
{
		return (a<b?a:b);
}


int main(){
	int x = 89;
	double y = 56.78;

	cout << smaller(x, y) << endl;

}
```