62得票1回答
GCC无法区分operator++()和operator++(int)。

template <typename CRTP> struct Pre { CRTP & operator++(); }; template <typename CRTP> struct Post { CRTP operator++(int);...

60得票4回答
初始化列表中元素的数量为什么会导致模棱两可的调用错误?

为什么编译器认为前两个对 doSomething 的调用是正确的,但使用列表中的两个元素会导致一个模糊的调用?#include <vector> #include <string> void doSomething(const std::vector<std::...

58得票1回答
使用 LINQ 扩展方法在 DbSet<T> 上时出现了模糊的调用错误。

我正在一个 DbSet&lt;T&gt; 上使用 LINQ 查询:await _dbContext.Users.AnyAsync(u =&gt; u.Name == name); 然而,编译器输出以下错误:Error CS0121: The call is ambiguous between ...

46得票2回答
函数模板的偏序 - 模棱两可的调用

考虑这段C++11代码: #include &lt;iostream&gt; #include &lt;cstddef&gt; template&lt;typename T&gt; void f(T, const char*) //#1 { std::cout &lt;&lt; ...

29得票6回答
调用存在歧义,即扩展方法和单一方法

我有一个类似的扩展方法:public static class Extension { public static string GetTLD(this string str) { var host = new System.Uri(str).Host; ...

23得票4回答
Specflow测试步骤继承导致"模棱两可的步骤定义"错误。

我希望拥有以下的测试步骤类结构:[Binding] public class BaseStep { [Given(@"there is a customer")] public void GivenThereIsACustomer(Table table) { ...

23得票2回答
圆周率常数存在歧义。

考虑以下代码:fn main() { let i = f32::consts::PI; } 带以下错误:$ rustc --version rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14) $ rustc - &lt;anon&...

22得票1回答
调用重载的<大括号初始化列表>是模棱两可的,如何处理?

我真的不理解这个,我以为编译器首先执行括号里的内容,然后将结果提供给最合适的函数。但在这里,它看起来像是给函数一个初始化列表来处理它...#include &lt;string&gt; #include &lt;vector&gt; using namespace std; void fun...

20得票1回答
为什么在C++中函数重载会产生二义性错误?

在下面的代码片段中,在函数调用f(1)中,1是一个int类型的字面量,在第一个函数void f(double d)中,参数类型是double,而在第二个函数void f(short int i)中,参数类型是short int。 这里1是int类型而不是double类型,那么为什么编译器会生...

19得票1回答
Java 8中的模糊方法,为什么会出现这种情况?

public static void main(String... args){ then(bar()); // Compilation Error } public static &lt;E extends Exception&gt; E bar() { return nu...