ambiguous

C++ Most vexing parse when a number literal is the argument? [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-20 06:28:10
问题 This question already has an answer here : Why can in-class initializers only use = or {}? (1 answer) Closed last year . I was making a class that looked like this: struct InputHandler { std::vector<std::pair<int, int>> keyBindings( 256 ); }; It came up with an error, and I know this is because the compiler interprets this as a function instead of a constructor argument. But I was wondering is there anything ambiguous when I've passed a number literal in brackets such as in this case? I know

Call of overloaded constructor is ambiguous

时光怂恿深爱的人放手 提交于 2019-12-20 04:55:18
问题 I am trying to implement an object-oriented binary tree, however, I get the error message of a call of an overloaded constructor being ambiguous. The problem is that I really do have the necessary constructor, yet C++ doesn't seem to recognize it. My code: http://pastebin.com/PM9PDYAN The error message: 56 36 In constructor 'Node::Node(const int&, Node*, Node*, const int&)': 56 36 [Error] call of overloaded 'Node(const int&, Node* const)' is ambiguous 17 3 [Note] Node::Node(const int&, Node*)

Join multiple tables with same column name

别等时光非礼了梦想. 提交于 2019-12-19 09:47:53
问题 I have these tables in my MySQL database: General table: +----generalTable-----+ +---------------------+ | id | scenario | ... | +----+----------+-----+ | 1 | facebook | ... | | 2 | chief | ... | | 3 | facebook | ... | | 4 | chief | ... | Facebook Table: +----facebookTable-----+ +----------------------+ | id | expiresAt | ... | +----+-----------+-----+ | 1 | 12345678 | ... | | 3 | 45832458 | ... | Chief Table: +------chiefTable------+ +----------------------+ | id | expiresAt | ... | +----+--

Multiple Inheritance Template Class

假装没事ソ 提交于 2019-12-19 06:29:19
问题 class messageA { }; class messageB { }; template<class T> class queue { public: virtual ~queue() {} void submit(T& x) {} }; class A : public queue<messageA>, public queue<messageB> { }; int main() { A aa; aa.submit(messageA()); aa.submit(messageB()); } My first thought is, the above code should be fine, as class A will contains 2 overloaded submit functions, which will accept messageA and messageB object. However, the compiler gives me the following error : May I know why there is an

Ambiguous method in Java 8, why? [duplicate]

雨燕双飞 提交于 2019-12-18 12:54:18
问题 This question already has answers here : Java type inference: reference is ambiguous in Java 8, but not Java 7 (2 answers) Closed 4 years ago . public static void main(String... args){ then(bar()); // Compilation Error } public static <E extends Exception> E bar() { return null; } public static void then(Throwable actual) { } public static void then(CharSequence actual) { } Compilation result (from command line javac Ambiguous.java ) Ambiguous.java:4: error: reference to then is ambiguous

BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'

我怕爱的太早我们不能终老 提交于 2019-12-18 05:52:36
问题 When I compiled my latest asp.net program and trying to run on the test server, I am getting this error Line 46: Dim dependencies() As String Line 47: CType(Me,Global.System.Web.UI.Page).AppRelativeVirtualPath = "~/default.aspx" Line 48: If (Global.ASP.default_aspx.__initialized = false) Then Line 49: dependencies = New String(0) {} Line 50: dependencies(0) = "~/default.aspx" Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web

Ambiguous column query

帅比萌擦擦* 提交于 2019-12-13 04:17:17
问题 I'm getting the "ambiguous column" error when running this query, but I'm having a hard time finding the cause: select bobooks.ID request, bobooks.TITLE, bobooks.AUTHOR, bogenres.NAME genre, bobooks.OWNER, bostatus.NAME status, bolanguages.LANGUAGE language, bolanguages2.LANGUAGE secondary_language from BO_BOOKS bobooks inner join BO_GENRES bogenres on bobooks.genre = bogenres.id inner join BO_STATUS bostatus on bobooks.status = bostatus.id inner join BO_LANGUAGES bolanguages on bobooks

ambiguous type error when using type families, and STV is not helping

拈花ヽ惹草 提交于 2019-12-13 02:25:49
问题 {-# LANGUAGE Haskell2010 #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} class PoC m where type Wrapper m :: * -> * wrap :: l -> Wrapper m l I'm working with haskell-src-exts, and I want to upgrade my AST to have freshly generatable labels. Since I want to do it in an extensible fashion, I created an interface like the code above. However, code to upgrade the AST doesn't work. I have the following: upgrade :: forall f m l. (PoC m, Functor f) => f l -> f (Wrapper m l)

implicit conversion sequence in function overloading

你。 提交于 2019-12-12 15:07:49
问题 I don't understand how the compiler chooses the best candidates. For example, let's have the following code: int function(double, int, int){...} int function(int, double, double){...} If the second function needs to convert two variables and the first one has to only convert one variable, how come the first one isn't chosen? Why is this an ambiguous situation? 回答1: Why is this an ambiguous situation? According to §13.3.3/1, Given these definitions, a viable function F1 is defined to be a

After Swift 3 conversion, I can't get rid of error: “Ambiguous use of 'indexOfObject(passingTest:)'”

别来无恙 提交于 2019-12-12 10:48:11
问题 I'm using NSArray 's indexesOfObjects(passingTest:), but after I converted my code to Swift 3 I get the error: "Ambiguous use of 'indexOfObject(passingTest:)'". My code below worked fine with Swift 2.3. let indexesOfBubbleConstraints = bubbleConstraints.indexesOfObjects(passingTest: { (constraint, idx, stop) in if let view = constraint.firstItem as? UIView{ return view.tag == usernameTag } else{ return false } }) For Swift 3, I also had to cast constraint to AnyObject , but that doesn't fix