If this is a compiler bug (seems doubtful), does anyone know any workarounds that don't involve converting amem into a function with a bool parameter (rather than a template)? I've done this already and I can confirm that this works around the issue, but this is inside a hot loop and the code that is switched on by b is a memory allocation that probably shouldn't be in a hot loop.推荐答案需要添加template关键字:return ap->template amem<b>();请阅读哪里以及为什么我必须放置模板"和类型名称"关键字?以获得深入的解释.Please read Where and why do I have to put the "template" and "typename" keywords? for an in-depth explanation. 这篇关于在模板类中调用模板方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-21 18:08