Category : ambiguous

Actually this code works fine in "DEV C++", but when I put it into my "Hacker-Rank" panel it gives this error "reference to function is ambiguous", although all the online compilers are giving errors… I don’t think here function overloading is somewhere interrupting, because this error mostly comes in function overloading. #include <bits/stdc++.h> #include <cstdio> ..

Read more

How could i select the overloaded function that i mean to call ? Consider this code: void foo (std::vector<int> const &variable); void foo (std::vector<int> variable); For example in above code i want to call void foo (std::vector<int>);, I tried : void bar () { std::vector<int> tmp; foo(tmp); foo(static_cast<std::vector<int>(tmp)); foo(boost::implicit_cast<std::vector<int>>(tmp)); foo((std::vector<int>)tmp); foo(std::vector<int>(tmp)); } But it’s failed, ..

Read more