template metafunction for detecting template specialisations

人走茶凉 提交于 2019-12-01 03:46:56

It seems unlikely, to be honest (although I can't definitively rule out a cunning trick).

There is no first-class identity for a given specialization (outside the type arguments that select it), to compare.

So, you could make it work with your own templates, if you want, but you can't write an ad-hoc inference for existing templates.

Consider also that it wouldn't work anyway, in the sense that it couldn't tell whether two instantiations have a compatible layout: even if Templ<int> and Templ<char> are instantiated from the same template code, with no specialization, that code can use traits classes which are specialied.

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