草庐IT

ambiguous-grammar

全部标签

android - 错误 : Ambiguous method call. AppCompactActivity 和 Activity 中的 findViewById (int)

我收到错误消息:使用AndroidStudio3.0RC1初始化工具栏时出现“不明确的方法调用”。我已经使用AppCompatActivity扩展了我的Activity,并使用“compileSdkVersion26”编译了我的应用程序。附上错误截图。 最佳答案 如果您最近将项目更新为API,请尝试这样做File->InvalidateCaches/Restart然后File->SyncProjectwithGradleFiles为我解决这个问题。 关于android-错误:Ambigu

C++ Cout & Cin & 系统 "Ambiguous"

关闭。这个问题需要detailsorclarity.它目前不接受答案。想要改进这个问题吗?通过editingthispost添加详细信息并澄清问题.关闭8年前。Improvethisquestion我只是在C++中编程,突然间所有的“cout”和“cin”都是错误和“模棱两可的”。包括系统。我不知道为什么会这样。一切都很好,我在同一个程序中编写了大约2个小时,然后它就……发生了。编辑我仍然可以无错误地运行程序,但它们在文本中显示为错误,即红色涂鸦线。发生了什么?我正在使用VisualStudio2013IDE,无论它附带什么。#include#include#include#inclu

C++ Cout & Cin & 系统 "Ambiguous"

关闭。这个问题需要detailsorclarity.它目前不接受答案。想要改进这个问题吗?通过editingthispost添加详细信息并澄清问题.关闭8年前。Improvethisquestion我只是在C++中编程,突然间所有的“cout”和“cin”都是错误和“模棱两可的”。包括系统。我不知道为什么会这样。一切都很好,我在同一个程序中编写了大约2个小时,然后它就……发生了。编辑我仍然可以无错误地运行程序,但它们在文本中显示为错误,即红色涂鸦线。发生了什么?我正在使用VisualStudio2013IDE,无论它附带什么。#include#include#include#inclu

C++ 编译器错误 : ambiguous call to overloaded function

stringaux;intmaxy,auxx=0;cin>>aux;maxy=(int)sqrt(aux.size());我得到:1>errorC2668:'sqrt':ambiguouscalltooverloadedfunction1>couldbe'longdoublesqrt(longdouble)'1>or'floatsqrt(float)'1>or'doublesqrt(double)'为什么? 最佳答案 string::size()返回size_t,而sqrt在其任何版本中都不接受它。所以编译器必须强制转换,并且不能选

C++ 编译器错误 : ambiguous call to overloaded function

stringaux;intmaxy,auxx=0;cin>>aux;maxy=(int)sqrt(aux.size());我得到:1>errorC2668:'sqrt':ambiguouscalltooverloadedfunction1>couldbe'longdoublesqrt(longdouble)'1>or'floatsqrt(float)'1>or'doublesqrt(double)'为什么? 最佳答案 string::size()返回size_t,而sqrt在其任何版本中都不接受它。所以编译器必须强制转换,并且不能选

c++ - 使用花括号初始化列表 : ambiguous or not? 调用显式构造函数

考虑以下几点:structA{A(int,int){}};structB{B(A){}//(1)explicitB(int,int){}//(2)};intmain(){Bparen({1,2});//(3)Bbrace{1,2};//(4)}(4)中brace的构造清晰明确地调用了(2)。在clang中,(3)中paren的构造明确地调用(1),而在gcc5.2中,它无法编译:main.cpp:Infunction'intmain()':main.cpp:11:19:error:callofoverloaded'B()'isambiguousBparen({1,2});^main.c

c++ - 使用花括号初始化列表 : ambiguous or not? 调用显式构造函数

考虑以下几点:structA{A(int,int){}};structB{B(A){}//(1)explicitB(int,int){}//(2)};intmain(){Bparen({1,2});//(3)Bbrace{1,2};//(4)}(4)中brace的构造清晰明确地调用了(2)。在clang中,(3)中paren的构造明确地调用(1),而在gcc5.2中,它无法编译:main.cpp:Infunction'intmain()':main.cpp:11:19:error:callofoverloaded'B()'isambiguousBparen({1,2});^main.c

Java 类型推断 : reference is ambiguous in Java 8, 但不是 Java 7

假设我们有2个类(class)。空类Base,以及此类的子类Derived.publicclassBase{}publicclassDerivedextendsBase{}那么我们在另一个类中有几个方法:importjava.util.CollectionpublicclassConsumer{publicvoidtest(){set(newDerived(),newConsumer().get());}publicTget(){return(T)newDerived();}publicvoidset(Basei,Derivedb){System.out.println("base")

Java 类型推断 : reference is ambiguous in Java 8, 但不是 Java 7

假设我们有2个类(class)。空类Base,以及此类的子类Derived.publicclassBase{}publicclassDerivedextendsBase{}那么我们在另一个类中有几个方法:importjava.util.CollectionpublicclassConsumer{publicvoidtest(){set(newDerived(),newConsumer().get());}publicTget(){return(T)newDerived();}publicvoidset(Basei,Derivedb){System.out.println("base")

java - "The constructor ... is ambiguous"是什么意思?

我想知道Eclipse中的错误信息是什么意思:TheconstructorCase(Problem,Solution,double,CaseSource)isambiguous 最佳答案 当您尝试实例化一个可以应用于多个构造函数的类时,就会出现问题。例如:publicExample(Stringname){this.name=name;}publicExample(SomeOtherother){this.other=other;}如果您使用String对象调用构造函数,则有一个明确的构造函数。然而,如果你实例化newExample