This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: :? ??
- From: Joe Buck <Joe dot Buck at synopsys dot com>
- To: matzmich at cs dot tu-berlin dot de (Michael Matz)
- Cc: Joe dot Buck at synopsys dot COM (Joe Buck),snowwolf at one2one-networks dot com (Allan Sandfeld Jensen),gcc at gcc dot gnu dot org
- Date: Tue, 19 Mar 2002 10:17:49 -0800 (PST)
- Subject: Re: :? ??
> On Tue, 19 Mar 2002, Joe Buck wrote:
>
> > > Is it doing:
> > > (exp) ? QString("xyz") : a
> > > or
> > > QString(exp ? "xyz" : (const char*)a);
> >
> > Does QString define an operator const char*() ?
>
> Under certain circumstances. In "strict" mode it doesn't.
If there is both an operator const char*() and a constructor that takes
a const char* argument that is not marked explicit, then
QString qstring_var;
...
QString fred = cond ? "foo" : qstring_var;
is ambiguous, otherwise not.