是否有相当于&lt ;?延伸T>,<?超T>在C ++中? [英] Is there equivalent of <? extends T>, <? super T> in C++?

查看:120
本文介绍了是否有相当于&lt ;?延伸T>,<?超T>在C ++中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 是否有相当于< ;?扩展T> <? C ++中的超级T>


  2. 另外,< ;?扩展T> ,<?即使 T 是Java中的一个接口,超级T> 仍然可以工作



解决方案

回答第一部分:限制模板功能



JesperE第二部分的答案正确。


  1. Is there equivalent of <? extends T>, <? super T> in C++?

  2. Also, does <? extends T>, <? super T> work even if T is an interface in Java?

解决方案

answer to the first part: Restrict Template Function

JesperE has the answer right for the 2nd part.

这篇关于是否有相当于&lt ;?延伸T&gt;,&lt;?超T&gt;在C ++中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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