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
0
votes
0 answers

Ambiguous Method

I have this piece of code: public Paragraph paragraph() { Paragraph paragraph = new Paragraph(before.getLeading()); paragraph.add(before); if (numbered) { paragraph.addSpecial(new Chunk(String.valueOf(pageN), before.getFont())); …
Jamal
  • 27
  • 2
  • 6
0
votes
1 answer

Find percentage and rounding it two places

I know this is basic one I'm asking, bear with me. I'm trying to find out the percentage. This is what I'm trying, but it is giving me an error of ambiguous call. int total = 1; int totalUsers = 3; if (totalUsers > 0) { var per =Math.Round(total…
ankur
  • 4,565
  • 14
  • 64
  • 100
0
votes
1 answer

Ambiguity with variadic templates

I've got a question regarding variadic templates. I've got a class that uses them in the following way: template struct A { A(B& arg); // (1) A(typename T::B& args...); // (2) }; typename T::B is some type that…
Markus Mayr
  • 4,038
  • 1
  • 20
  • 42
0
votes
3 answers

Overload resolution in a call with NULL as argument

I have two overloaded constructors: Hello::Hello(std::string message) { } Hello::Hello(int *number) { } Either of those constructors can take a memory address. If I did Hello hi(NULL); then which would be called? Also if you could explain the…
loop
  • 3,460
  • 5
  • 34
  • 57
0
votes
3 answers

C++: Constructor ambiguity

Will this cause an ambiguity?: class A { ... }; class B : public A { //... B(const B& b); B(const A& a); //... };
Casey
  • 10,297
  • 11
  • 59
  • 88
0
votes
1 answer

'HttpWebRequest' is ambiguous in the namespace 'System.Net'.

Possible Duplicate: Saved program and now it does not compile I have a whole bunch of these errors, along with designer errors and such. I checked the object browser and it's not ambiguous, only one instance of HttpWebResponse in system.net I am…
Austin Burk
  • 930
  • 4
  • 15
  • 33
0
votes
1 answer

error C2593: 'operator =' is ambiguous in vc6 project when convert it into vc9

In vc6,The code CString strData; int count=3; strData = strData.Delete(0,count);//error execute perfectly, But In vc9 it gives an error that error C2593: 'operator =' is ambiguous can i use only strData.Delete(0,count);
jiten
  • 5,128
  • 4
  • 44
  • 73
0
votes
2 answers

Undefined variable as function argument javascript

I've looked a fair bit, so pardon me if this has already been answered. I'm also curious as to what the actual term is called; Is it "Ambiguous" for the type of arguments I am handling? Anyways, the problem is that I want to be able to call a…
0
votes
1 answer

Ambiguous Sub Name with VBA in Excel

What's wrong with this sub name which gives me an ambiguous name detected error? Public Property Get G_EtoW_Pad() G_EtoW_Pad = EtoW_Pad End Property
Ehudz
  • 613
  • 10
  • 22
  • 33
0
votes
3 answers

The call is ambiguous between the following methods or properties (decimal and double, with rounding)

My program cannot determine whether to execute Math.Round as a decimal or a double, but I have no idea how to fix this... Here is my code, though the second to last line is what I am concerned with. ArrayList topp1 = new ArrayList(); int toppcount…
Wilson
  • 8,570
  • 20
  • 66
  • 101
0
votes
1 answer

ambigious definitions in c++

I can't find out why calls of f are ambigiuous :/ I know that the three declarations are ok but in this case this isn't working.. #include using namespace std; void f(int); void f(int &); void f(const int &); void f(int a); void f(int…
0
votes
6 answers

Removing ambiguity when using sqrt() function in a template class

I have a complex number class where I am trying to implement a function to work out the modulus (which requires the used of a sqrt). My header file is as follows: #ifndef MY_CLASS_H #define MY_CLASS_H template class complex { //…
QuantumO
  • 187
  • 2
  • 12
-1
votes
1 answer

find max value between three columns

I'm trying find max value between three columns, but I get the error (The truth value of a Series is ambiguous). I have a dataframe like this: TR0 TR1 TR2 TR 3.25 2.19 0.15 3.0 0 0.14 I need put in column "TR" the max value between…
Alex5672
  • 13
  • 2
-1
votes
1 answer

Resolving an ambiguous call in C++

I have a problem where I want to overload 2 functions by swapping the default parameters to make it possible to swap them in a call. Create(UncachedGraph* graph, std::string name, Node* parent, std::string path = "", int pos =…
NotYourFox
  • 35
  • 5
-1
votes
1 answer

why does the following code generate a "reference to 'tm' is ambiguous" error?

#include using namespace std; namespace characters { char tm='a'; char tc='a'; } using namespace characters; class table { public: void printline (){ char m; m=tm; //m=tc; …