From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 20 22:10:12 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F686D24; Fri, 20 Dec 2013 22:10:12 +0000 (UTC) Received: from mail-oa0-x22b.google.com (mail-oa0-x22b.google.com [IPv6:2607:f8b0:4003:c02::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58F0D1F50; Fri, 20 Dec 2013 22:10:12 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id i7so3553364oag.30 for ; Fri, 20 Dec 2013 14:10:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=x+V+FlnnkUm1PXaJJrL4JDlg1AETO69BJu0QHmPV6qc=; b=TqhVPTkFrxXWWnnA6Jc7aUx2zFwO13kQtXUbVj1YT+tGh990hOgVMXIF1qJmroEcEY pzpS4Yn1jX53Oss6hBuLhKzu+GtROODsMZGEI9g4ChS/qExZFtfEvbwwpeI17rGrvIRJ l3GobJl6Z9+YDZfOMiU4VeSOAFAUOsJURLOCIx6cc4qKLDg5k9AAGbBIbNd/ISqBFem/ /gTOCfVXCEWTl5PoEV/OhwiMXpyb8yxuPuqHNq0KGv7bo+kxTe0TDdgSseETG9tAJT3K 5PwCIL+/2jauCxy+Mq6WR4jUAsgusawGzDx3QsGzVv++cNtor+yA6d9qQlOdKHLzfNlc YwPg== MIME-Version: 1.0 X-Received: by 10.182.81.197 with SMTP id c5mr8384019oby.40.1387577411533; Fri, 20 Dec 2013 14:10:11 -0800 (PST) Received: by 10.182.78.100 with HTTP; Fri, 20 Dec 2013 14:10:11 -0800 (PST) In-Reply-To: References: Date: Fri, 20 Dec 2013 17:10:11 -0500 Message-ID: Subject: Re: C++ overloaded virtual function From: Joe Nosay To: Alan Somers Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 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 22:10:12 -0000 On Fri, Dec 20, 2013 at 12:52 PM, Alan Somers wrote: > 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" > New error:: /usr/home/raspycat/traverso/work/traverso-0.49.2/src/engine/Driver.h:50:85: error: invalid use of non-static data member 'NoneQString' ...bool playback=true, const QString& cardDevice=NoneQString);