Is it possible to infer template parameters of tuple from brace-type initialization?

不想你离开。 提交于 2019-11-30 15:40:52

No, there is absolutely no way. Deduction fails if the element types are not of the same type. And no deduction is done at all if the parameter is not a std::initializer_list<T> anyway (you are right that initializer_list doesn't have anything to do with the braces you give, but this is the simple rule for deduction to work).

The template parameter values must be deduced by other function parameter positions involving them or must be explicitly specified.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!