Questions tagged «template-function»

4
ADL为什么找不到功能模板?
C ++规范的哪一部分限制了依赖于参数的查找,无法在关联的命名空间集中查找函数模板?换句话说,为什么main下面的最后一个调用无法编译? namespace ns { struct foo {}; template<int i> void frob(foo const&) {} void non_template(foo const&) {} } int main() { ns::foo f; non_template(f); // This is fine. frob<0>(f); // This is not. }
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.