g++ -Waddress may misunderstand my meaning

試著忘記壹切 提交于 2019-12-06 04:13:00

Because this is compile-time code, in this template instantiation Bar will never be null - there is only one value for this. You should not mix compile-time programming with dynamic branching. To achieve your goal (not that I understand why you want your Bar to be template argument) you need to have a specialization of your foo for nullptr.

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