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
3
votes
1 answer

How does the Swift Dictionary subscript disambiguate Int keys and indices?

Currently I'm working on a data structure intended to store store key-value pairs uniquely and keep them sorted by key. Essentially it is a sorted dictionary and as such I am seeking to keep as much of the Collection and Dictionary semantics of…
Matthew M.
  • 31
  • 2
3
votes
1 answer

Ambiguous method from inheritance when using a CRTP pattern

I am defining a DoubleWrapper class inheriting from two CRTP base classes, Ratioable and Divable, that both define operator/(), with different signatures: T operator/(double const& scalar) const { return T(this->underlying().get() / scalar);…
gg99
  • 445
  • 6
  • 12
3
votes
2 answers

Is there a warning free template function to convert basic types to string

I want to provide a templated function that converts most basic types to string. The best I have come up with so far is the following: template inline std::string anyToString(const T& var) { std::ostringstream o; o << var; return…
Martin
  • 4,738
  • 4
  • 28
  • 57
3
votes
1 answer

Hive IllegalStateException Ambiguous Input path

Im running a query in hive on a table with partitions. select count(*) from activity where datestamp=2016-08-16 However the query throws the following exception java.lang.IllegalStateException: Ambiguous input path…
Himateja Madala
  • 321
  • 1
  • 4
  • 16
3
votes
0 answers

Ambiguous use of Function Error

I use the following code, @IBOutlet weak var hashtagableTextView: UITextView! In viewDidload method: let hashtagableDelegate = HashtagableTextInputDelegate(textView: hashtagableTextView, userDelegate:…
Lavanya D
  • 31
  • 3
3
votes
1 answer

Visual Studio 2008 - error C2872: 'NPC' : ambiguous symbol

I try to correct my last error on my code. I have migrate VS6.0 to VS2008. My last error is in my SimpleNPC.cpp file: .\SimpleNPC.cpp(216) : error C2872: 'NPC' : ambiguous symbol could be '.\SimpleNPC.cpp(30) : NPC_Editor::NPC…
3
votes
2 answers

Ambiguous reference in swift3

Hi after migrating to swift3. I m having this issue? Do your guys know what wrong? ambiguous reference to member "/" let rateForPeriod = interestRate! / Double(100) / Double(K.monthsEachYear)
Stefan Lam
  • 130
  • 10
3
votes
1 answer

Function type has ambiguous reference to member nextInt()

My intent is to use nextInt(upperBound: Int) let randomInt: (Int) -> Int = GKRandomSource.sharedRandom().nextInt var myNumber = randomInt(10) Produce error: Playground execution failed: error: ambiguous reference to member 'nextInt()' Why? Swift…
Atsuo Sakakihara
  • 179
  • 1
  • 3
  • 12
3
votes
4 answers

Color(int, int, int) vs Color(float, float, float) ambiguous call

How can I resolve the ambiguous call between these two in C++? Color(int, int, int) Color(float, float, float) It is both ambiguous when the values are hardcoded i.e. Color(1, 2, 3) and when they are variables Color(r, g, b). Why wouldn't the…
Jake
  • 11,273
  • 21
  • 90
  • 147
3
votes
2 answers

Ambiguous redirect error in shell scripting when creating file name with date

I'm trying to make this temperature log in Raspberry Pi happen (though some of the code did not work therefore I used slightly diff. solutions): https://www.raspberrypi.org/learning/temperature-log/worksheet/ I'm stuck with writing the results in a…
Gabor
  • 43
  • 1
  • 1
  • 5
3
votes
2 answers

JPA ambiguous method call isMember

CriteriaBuilder has overloaded method isMember(...) Create a predicate that tests whether an element is a member of a collection. > Predicate isMember(E elem, Expression collection)
Dave
  • 759
  • 2
  • 9
  • 31
3
votes
1 answer

How can I make a MethodCallExpression for a method?

If I have a method name, and the parameters for the method, how can I create a MethodCallExpression for the method? Here is an example method: public void HandleEventWithArg(int arg) { } Here is the code that I have: var methodInfo =…
Simon
  • 7,991
  • 21
  • 83
  • 163
3
votes
6 answers

updated_at column ambigious while updating with eloquent

I have 3 table cart,pharmacy and cart_pharmacies cart table cart_id | user_id | total_price | status | created_at | updated_at pharmacy table pharmacy_id | name | address_id | created_at | updated_at cart_pharmacies table cart_pharmacies_id |…
Umar Akbar
  • 123
  • 2
  • 7
3
votes
0 answers

In which ways can ambiguity be resolved in inheritance?

I am currently learning C++. There are only 2 ways i have come across to resolve ambiguity, one is by using scope resolution operator (::) and another by using 'virtual' keyword when I am dealing with multiple inheritance and hybrid inheritance. My…
3
votes
3 answers

Oracle SQL column ambiguously defined with UNION ALL

I have two tables with similar data, and I need to query the union of the tables. I have changed the actual table names I'm using to only illustrate the issue: SELECT UORD.ORDER_NUM FROM (SELECT ORDER_ID, ORDER_NUM, PKG_ID FROM ORDER …
yas
  • 3,520
  • 4
  • 25
  • 38