在C ++中什么是模板<>意思? [英] In C++ what does template<> mean?

查看:292
本文介绍了在C ++中什么是模板<>意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不是我熟悉的语法,但我在中看到了另一个问题,例如:

It's not a syntax I'm familiar with, but I saw it in another question, an example being:

template<> struct Allowed<std::string> { };

模板<> ,没有模板类型/参数?

What does template<> actually mean, with no template type/parameter?

推荐答案

template<> 表示专业化本身不是模板化的,即它是一个明确的专业化,而不是部分专业化。

It's a specialization. template<> means that the specialization itself is not templated- i.e., it is an explicit specialization, not a partial specialization.

这篇关于在C ++中什么是模板&lt;&gt;意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆