Lars Gullik Bjønnes wrote:
Angus Leeming <[EMAIL PROTECTED]> writes:

| Peter Kümmel <[EMAIL PROTECTED]> writes:
| > > Yes, it's MSVC. It's a performance warning about possibly loosing
| > > precision due to the automatic cast. You can get rid of the warning via
| > > an explicit cast.
| > > | > > + return bool(provides_ & p); | > | > Yes, that's a better solution. | | It's certainly clear what's going on. | | Obviously, I'm in a pedantic mood. These two are casts:
|    (bool)1;
|    static_cast<bool>(1);
| This one isn't:
|    bool(1);

I think I still prefere this last one.

Actually I suggested that cast type because you told me once that (bool) cast type are C-ish and bool() cast type are C++-ish...

| Ain't C++ funky? ;-)
| | > (the warning was:
| > ..\..\lyx-devel\src\lyxtextclass.C(1065) : warning C4800: 'int' :
| > forcing value to bool 'true' or 'false' (performance warning)
| > )

Why is it a performance warning?

Because you loose precision: 32 bits -> 1 bit

Abdel.

Reply via email to