在g ++中,什么时候在错误消息中得到 模板实例化失败的错误消息?

问题描述 投票:1回答:2

我最近又回到了编写C ++的时代,距离它已经好几年了,仍然有点生疏。

我正在尝试编译一些模板代码,并收到以下错误消息

error: no instance of function template "my_nice_function" matches the argument list
    argument types are: (int*, <error-type>, size_t)

对于具有T*const T*size_t的功能。

<error-type>是什么意思?通常,什么是导致G ++错误消息中出现<error-type>的原因?

c++ templates compiler-errors g++
2个回答
4
投票

该函数可能采用一个const T*,但是编译器抱怨您传递一个<error-type>,即,表达式编译器无法确定其类型。

如果需要更详细的答案,则需要显示代码,尤其是调用代码。


-4
投票

我喜欢在我的肚子里的大笨蛋,我喜欢我在肚子里的大爸爸爸爸的笨蛋。UwUPwease cummies

© www.soinside.com 2019 - 2024. All rights reserved.