From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 20 17:52:56 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D3161DC for ; Fri, 20 Dec 2013 17:52:56 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3574319FD for ; Fri, 20 Dec 2013 17:52:56 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id hi5so8747863wib.2 for ; Fri, 20 Dec 2013 09:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=MV173SEdpTAOHfL9ov8XSsPXciBd71u/NL5CdeBif+0=; b=ayPjSy69RX83srD6YPPXYGbQI+0Ns5Refw41fh28MlPxpvMKW0p2IRP9dZQcpY9vvN kmOP066SFhQKgdPfIj9+9gLnL9CxzJ6sw/ps7anedOjnirksUuq92Nl4ozVDtEJd1sej VKzORlH6RRh1EjIPYVapk0cNKY53TfKGnxZZhiPUgdrzQ6d+IXbTjGEqBeSyCLm5YK03 SW60k6kVCmhAlXmYoZdOBn/emU7FeR+gcoxuRA+dO7HOdu5UyQA84XocvuKE20U8e7WJ 4gHLK0Cxty3CJu9L167TYPHdGzUC8Au4m4D+9rVZXCG1vUkQ9Hk5rPYnP9MFWDMdvzaq ElLw== MIME-Version: 1.0 X-Received: by 10.180.105.199 with SMTP id go7mr8475913wib.53.1387561974521; Fri, 20 Dec 2013 09:52:54 -0800 (PST) Sender: asomers@gmail.com Received: by 10.194.55.101 with HTTP; Fri, 20 Dec 2013 09:52:54 -0800 (PST) In-Reply-To: References: Date: Fri, 20 Dec 2013 10:52:54 -0700 X-Google-Sender-Auth: 0ErRXQvnf9YU2JeRVJk7nHPI0dY Message-ID: Subject: Re: C++ overloaded virtual function From: Alan Somers To: Joe Nosay Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 17:52:56 -0000 On Fri, Dec 20, 2013 at 12:52 AM, Joe Nosay wrote: > /usr/home/raspycat/traverso/work/traverso-0.49.2/src/engine/Driver.h:49:14: > note: hidden overloaded virtual function 'Driver::setup' declared > here: different number of parameters (3 vs 4) > virtual int setup(bool capture=true, bool playback=true, const > QString& cardDevice="none" > > Three = and one &, the last being the odd man out. Both spacing and > removing the & still results in an error. > > Clang++ is expecting an absolute value such as the other three. > > How do I compensate for the & to have the same value type as =? Your prototype calls the QString constructor within the prototype itself. I don't know if that's illegal, but it's certainly weird. I would try creating a global variable for "none", and reference that object in the prototype, like this: Driver.h: QString NoneQString; virtual int setup(bool capture=true, bool playback=true, const QString& cardDevice=NoneQString); Driver.cc QString NoneQString("none"); -Alan > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"