ambiguous

Ambiguous C++ compiler error

随声附和 提交于 2019-12-04 04:04:14
The following bit of code fails to compile. The error seems to be some kind of ambigous call to the merge routine. My understanding is that STL has a merge routine found in the std namespace, but as far as I can tell the name merge in the code below should be unique. If I rename merge to xmerge, everything works. What could the problem be? where is the name clash coming from? http://codepad.org/uAKciGy5 #include <iostream> #include <iterator> #include <vector> template<typename InputIterator1, typename InputIterator2, typename OutputIterator> void merge(const InputIterator1 begin1, const

ICollection / ICollection<T> ambiguity problem

拈花ヽ惹草 提交于 2019-12-03 16:12:55
Just want to make simple extension for syntactic sygar : public static bool IsNotEmpty(this ICollection obj) { return ((obj != null) && (obj.Count > 0)); } public static bool IsNotEmpty<T>(this ICollection<T> obj) { return ((obj != null) && (obj.Count > 0)); } It works perfectly when I work with some collections, but when working with others I get The call is ambiguous between the following methods or properties: 'PowerOn.ExtensionsBasic.IsNotEmpty(System.Collections.IList)' and 'PowerOn.ExtensionsBasic.IsNotEmpty(System.Collections.Generic.ICollection)' Is there any canonical solution to this

Ambiguous use of 'subscript' with NSArray & JSON

无人久伴 提交于 2019-12-02 04:07:06
I have looked through the similar topics in stackoverflow but none of those solutions seem to work for me. I have an app that fetch video through youtube API . The following code is giving the error. var arrayOfVideos = [Video]() // I am getting the error for the following line and it says "Ambiguous use of 'subscript'. for video in JSON["items"] as! NSArray { let videoObj = Video() videoObj.videoId = video.valueForKeyPath("snippet.resourceId.videoId") as! String videoObj.videoTitle = video.valueForKeyPath("snippet.title") as! String videoObj.videoDescription = video.valueForKeyPath("snippet

Why is this implicit ambiguity behaviour happening?

纵饮孤独 提交于 2019-12-01 23:41:24
I have a typeclass Search , which has an instance Search[A] if we have a TypeClass1[A] or a TypeClass2[A] instance. With preference given to the 1 instance. The following compiles: trait TypeClass1[A] trait TypeClass2[A] trait Search[A] object Search extends LPSearch { implicit def case1[A](implicit ev: TypeClass1[A]): Search[A] = null } trait LPSearch { implicit def case2[A](implicit ev: TypeClass2[A]): Search[A] = null } object Test { implicit val ev1: TypeClass1[Int] = null implicit val ev2: TypeClass2[Int] = null implicitly[Search[Int]] } This is as I would expect, the implicit search

vb.net compile error 'abc' is ambiguous in the namespace 'xyz'

和自甴很熟 提交于 2019-12-01 22:19:10
问题 I have a VB.Net solution that another developer created and I'm trying to compile it on our build machine (it compiles on their machine) but with one of the projects I get an error saying something along the lines of: Imyinterface is ambiguous in the namespace anamespaceassembly . I have tried with no success: examined the references to see any obvious errors removed and re-added the assembly in question searched the system for the same dll attempted to compile the original deve's src (.v the

vb.net compile error 'abc' is ambiguous in the namespace 'xyz'

爷,独闯天下 提交于 2019-12-01 20:12:51
I have a VB.Net solution that another developer created and I'm trying to compile it on our build machine (it compiles on their machine) but with one of the projects I get an error saying something along the lines of: Imyinterface is ambiguous in the namespace anamespaceassembly . I have tried with no success: examined the references to see any obvious errors removed and re-added the assembly in question searched the system for the same dll attempted to compile the original deve's src (.v the source control version) examined the assembly with ildasm.exe I usually code in C# and have not seen

Ambiguous reference in WCF and client application

▼魔方 西西 提交于 2019-12-01 16:53:55
问题 I've managed to reproduce one of the errors in a test project with a similar structure to my production code. It consists of three simple projects: Common (class library): namespace Common { public enum PrimaryColor { Red, Green, Blue }; } Library (WCF service library), which has a reference to Common: using Common; namespace Library { [ServiceContract] public interface ILibrary { [OperationContract] PrimaryColor GetColor(); } public class Library : ILibrary { public PrimaryColor GetColor() {

What is an 'ambiguous type' error in Java?

不羁的心 提交于 2019-12-01 15:54:33
问题 In the following code, I get an error from the compiler on the last line that says: 'the type List is Ambiguous' (on the line that attempts to define cgxHist list). What am I doing wrong? import java.awt.*; import javax.swing.*; import java.util.*; public class drawr extends JPanel{ public static int animationSpeed=470; public static int diameter = 50; hBod allHBods[]; List<String> cgxHist = new ArrayList<String>(); I actually wanted the list to contain integers, but when I try to 'cast' the

Join multiple tables with same column name

别等时光非礼了梦想. 提交于 2019-12-01 08:38:14
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 | ... | +----+-----------+-----+ | 2 | 43547343 | ... | | 4 | 23443355 | ... | Basically, the general table holds some

Avoiding implicit def ambiguity in Scala

蓝咒 提交于 2019-12-01 02:39:08
I am trying to create an implicit conversion from any type (say, Int) to a String... An implicit conversion to String means RichString methods (like reverse) are not available. implicit def intToString(i: Int) = String.valueOf(i) 100.toCharArray // => Array[Char] = Array(1, 0, 0) 100.reverse // => error: value reverse is not a member of Int 100.length // => 3 An implicit conversion to RichString means String methods (like toCharArray) are not available implicit def intToRichString(i: Int) = new RichString(String.valueOf(i)) 100.reverse // => "001" 100.toCharArray // => error: value toCharArray