This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]