<span style="font-size:18px;">//函数模板</span>
<span style="font-size:18px;">template <class charT, class traits>
basic_ostream<charT,traits>& endl ( basic_ostream<charT,traits>& os );</span>
<span style="font-size:18px;">//类模板</span>
<span style="font-size:18px;">template <class char T,class traits></span>
<span style="font-size:18px;">class basic_ostream</span>
<span style="font-size:18px;">{</span>
<span style="font-size:18px;">
</span>
<span style="font-size:18px;">}</span>
<span style="font-size:18px;">//模板函数是函数模板的具体实现</span>
<span style="font-size:18px;">//模板类是类模板的具体实现,类是对象的抽象,类模板是类的抽象;</span>
<span style="font-size:18px;">//模板的引入提高了可移植性,模板本身与平台无关;类型无关保证了很高的可复用性;在编译时而不是运行时检查数据类型,保证了类型安全、</span>
<span style="font-size:18px;">//可以来创建动态增长和减小的数据结构</span>
// (1) delimiter as parameter
template<class CharType, class Traits, class Allocator>
basic_istream<CharType, Traits>& getline( basic_istream<CharType, Traits>& is, basic_string<CharType, Traits, Allocator>& str, CharType delim);
template<class CharType, class Traits, class Allocator>
basic_istream<CharType, Traits>& getline( basic_istream<CharType, Traits>&& is, basic_string<CharType, Traits, Allocator>& str, const CharType delim);
// (2) default delimiter used
template<class CharType, class Traits, class Allocator>
basic_istream<CharType, Traits>& getline( basic_istream<CharType, Traits>& is, basic_string<CharType, Traits, Allocator>& str);
template<class Allocator, class Traits, class Allocator>
basic_istream<Allocator, Traits>& getline( basic_istream<Allocator, Traits>&& is, basic_string<Allocator, Traits, Allocator>& str);