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