错误C2668:'System :: Collections :: IEnumerator :: Current :: get':对重载函数的模糊调用 [英] error C2668: 'System::Collections::IEnumerator::Current::get' : ambiguous call to overloaded function
问题描述
我们有一个类库,我们使用.net开发,在Managed C ++应用程序中使用相同。
We have a class library which we developed using .net and same using in Managed C++ application.
在托管C ++项目编译期间,我们得到以下错误以及如何解决问题。
During Managed C++ project compilation we are getting below error and how to resolve the issue.
错误C2668:'System :: Collections :: IEnumerator :: Current :: get':对重载函数的模糊调用
error C2668: 'System::Collections::IEnumerator::Current::get' : ambiguous call to overloaded function
2> Items.cpp(32):可能是'System :: Object ^ System :: Collections :: IEnumerator :: Current :: get(void)'
2> Items.cpp(32): could be 'System::Object ^System::Collections::IEnumerator::Current::get(void)'
2> ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; Items.cpp(32):或 'WDTransport :: Functions :: IItem ^ System :: Collections :: Generic :: IEnumerator< T> :: Current :: get(void)'
2> Items.cpp(32): or 'WDTransport::Functions::IItem ^System::Collections::Generic::IEnumerator<T>::Current::get(void)'
2>   ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; with
2> with
2> [
2> [
2> T = WDTransport :: Functions :: IItem ^
2> T=WDTransport::Functions::IItem ^
2> ]
2> ]
请帮助我们。
编辑:VS2012
问候,
Sivaprasad
Sivaprasad
推荐答案
嗨Sivaprasad T ,
Hi Sivaprasad T,
感谢您在此处发布。
>>错误C2668:'系统: :Collections :: IEnumerator :: Current :: get':对重载函数的模糊调用
请显示使用出现此错误的语句,以便我们可以帮助您找到根本原因。
Please show use the statements where you got this error so that we could help you find the root cause.
此错误表示无法解析指定的重载函数调用。您可能希望显式地转换一个或多个实际参数。或者,如果在同一个类中,您具有常规成员函数和具有相同
签名的模板化成员函数,则模板化的函数必须首先出现。这是Visual C ++当前实现的限制。
This error means the specified overloaded function call could not be resolved. You may want to explicitly cast one or more of the actual parameters. Or if , in the same class, you have a regular member function and a templated member function with the same signature, the templated one must come first. This is a limitation of the current implementation of Visual C++.
最好的问候,
Sera Yu
Sera Yu
这篇关于错误C2668:'System :: Collections :: IEnumerator :: Current :: get':对重载函数的模糊调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!