[Xapian-devel] str.h warning in MSVC 9.0

Eric Sellin eric at rxl1.com
Tue May 5 16:19:59 BST 2009


inline std::string str(bool value) {
  return value? "1": "0";
}

...and be done with it :)

E.

On Tue, 2009-05-05 at 16:10 +0100, Olly Betts wrote:
> On Tue, May 05, 2009 at 03:55:09PM +0100, James Aylett wrote:
> > On Tue, May 05, 2009 at 02:57:05PM +0100, Olly Betts wrote:
> > 
> > > http://msdn.microsoft.com/en-us/library/fx3e68bw(VS.80).aspx
> > > 
> > > There's no relational operator involved here, so this warning seems to
> > > be misfiring.
> > 
> > I'm going to take a guess and say it may be firing because it's
> > turning ('0' | value) into ('0'==true | value) or similar internally.
> 
> That would be a bogus transformation though, as this is a *bitwise* or.
> 
> Cheers,
>     Olly
> 
> _______________________________________________
> Xapian-devel mailing list
> Xapian-devel at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-devel
> 




More information about the Xapian-devel mailing list