SFINAE - 模板中的enable_if
ref : https://github.com/wuye9036/CppTemplateTutorial#323-特化一些其它问题
这段就是说: 这个int实参在替换第一个inc_counter时,enable_if<false>,所以直接替换失败。接下来替换第二个inc_counter,enable_if<true>,那么就会产生一个void inc_counter<int>(int & counterInt, void* dummy = nullptr);的函数签名,就替换成功了。
本文来自博客园,作者:ijpq,转载请注明原文链接:https://www.cnblogs.com/ijpq/p/17056704.html