Date: Fri, 20 Dec 2013 10:52:54 -0700 From: Alan Somers <asomers@freebsd.org> To: Joe Nosay <superbisquit@gmail.com> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: C++ overloaded virtual function Message-ID: <CAOtMX2g9=2GL1Ord9RoS1ErZnChGotJmaDGXbBC5-NwiGJ0Cag@mail.gmail.com> In-Reply-To: <CA%2BWntOsuO=VvEWaOHMDG_p50WM7wEwGiLK0h5cXDBQWzvhayhg@mail.gmail.com> References: <CA%2BWntOsuO=VvEWaOHMDG_p50WM7wEwGiLK0h5cXDBQWzvhayhg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 20, 2013 at 12:52 AM, Joe Nosay <superbisquit@gmail.com> 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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2g9=2GL1Ord9RoS1ErZnChGotJmaDGXbBC5-NwiGJ0Cag>