Questions tagged [ambiguous]

An ambiguous call is a situation in which the compiler cannot deduce which version of a function or method to use from the given parameter types. This tag should not be confused with the [ambiguity] tag.

An ambiguous call occurs when the parameters can be converted in many ways such that they fit more than one overload of a function. For example:

void f(float f)
{

}

void f(double d)
{

}

Passing an int value to this function will cause an ambiguous call compiler error, because int can be converted both to float and to double while the compiler is not able to choose the overloaded version of function uniquely.

612 questions
-2
votes
1 answer

Why is one expression ambiguous and the other not?

The following code works let evens = [1,2,2,3,4,5,6,6,7].reduce(Set()) { (var set: Set, int: Int) -> Set in if (true) { set.insert(int) } } ...but the compiler thinks this is ambiguous? let evens =…
user2320861
  • 1,391
  • 2
  • 11
  • 28
-2
votes
2 answers

simple join sql ambiguous column

I'm getting an ambiguous column error? Even though they are exactly the same like all the other columns that I selected. SELECT DISTINCT [date], [problem], [companyprofit], [fixtime] FROM [fixandresponse] , [netprofit] WHERE…
-2
votes
2 answers

Ambiguous recursive(?) overload call

How can I solve this? How can I point to the exact overload that I would like to use? int A() { if (Environment.TickCount == 666) return 0; else return 1; } bool A() { if (A() ==…
-3
votes
1 answer

Ambiguous Error At Overloaded Functions in C++17

I wrote c++17 code below : class Myclass{ public: Myclass() { std::cout << "ctor\n"; } Myclass(const Myclass&) { std::cout << "copy ctor\n"; } Myclass(Myclass&&) { std::cout << "move…
kaernk
  • 63
  • 6
-3
votes
1 answer

Example query from my textbook is coming up with an Error message. "Ambiguous column name 'V_CODE'"

For my homework, I have to enter example queries from the book to sql. There are also example database I downloaded for the homework and properly put them into SQL. The following is what I have to put in but an error message comes up. SELECT V_CODE,…
TXC517
  • 1
-3
votes
1 answer

Java JUnit Problem with Ambiguous contactService

I'm working on a school project and I have the JUnit test almost here but I cannot for the life of me get this to work. Contact looks like: public class Contact { private String contactID; private String firstName; private String…
-3
votes
1 answer

I have seen many cases with ambiguous problems and tried many stuff, still does not work

i want to know, why in this case, it keeps saying Quantity column is ambiguous, can anybody help? SELECT SUM(AmountPaid),SUM(Quantity), ice_cream.IceCream FROM ice_cream INNER JOIN ice_cream_ingredient ON (ice_cream.IceCreamID…
-3
votes
2 answers

ambiguous function call in children class C++

I have a question related with the example below: Class A{virtual foo(};virtual g()}; Class B: public A {virtual foo();virtual g()}; B::foo(){A::foo()}; A::foo(){g()}; When I call B::foo(), it will use B::g() not A::g(), how to explain it, is it…
CJAN.LEE
  • 1,108
  • 1
  • 11
  • 20
-4
votes
1 answer

Ambiguous/rvalue arguments cause compiler to choose incorrect overload

I have a home grown template class called Vec which is a pale shadow of: std::vector To avoid re-inventing the wheel the header overloads for assign are copied from: std::vector::assign ..so As part of testing Str class, ..test code is also…
tuk
  • 367
  • 1
  • 4
  • 10
-4
votes
1 answer

python script : sequence identifier and number of possible sequences

I need to work with python for a school project, but I really don't know how to start at it. The question is: A FASTA file contains a number of DNA sequences. Unfortunately, some of the symbols are ambiguous. The encoding is IUPAC…
-5
votes
1 answer

Prove that the following grammar is ambiguous

S-> A|B|AB A-> aA, B-> bB, A->€, B->€ € is the empty string. Find a string and show that it has two a-) parse trees b-) leftmost derivations c-) rightmost derivations
Tihyros
  • 15
  • 1
  • 5
-5
votes
2 answers

c++ compilation error: call of overloaded ‘(char*&)’ is ambiguous

I'm trying to convert a code in C to C++ language and I get an error but I've no idea what's the source of the problem. here is the source code: http://pastebin.com/PnKvgNsR The error message is: call of overloaded ‘dateTimeToMinutes(char*&)’ is…
MiP
  • 5
  • 3
1 2 3
40
41