Opened 10 years ago

Closed 10 years ago

#7493 closed Bugs (fixed)

compile fail on intel-linux-12.1.3.0x because of bug on explicit bool conversion

Reported by: viboes Owned by: viboes
Milestone: Boost 1.52.0 Component: chrono
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc:

Description (last modified by viboes)

The following code fails to compile with intel-linux-12.1.3.0x

          typename std::basic_ostream<CharT, Traits>::sentry opfx(os);
          if (opfx)
          {

with the message

../../../boost/chrono/io/duration_io.hpp(130): error: expression must have bool type (or be convertible to bool)
            if (opfx)

even if sentry defines an explicit bool conversion.

A workaround to this issue is needed.

Change History (4)

comment:1 by viboes, 10 years ago

Description: modified (diff)
Status: newassigned

It is enough to do the explicit conversion

          typename std::basic_ostream<CharT, Traits>::sentry opfx(os);
          if (bool(opfx))
          {

comment:2 by viboes, 10 years ago

Committed in trunk revision [80949][80950][80956].

Last edited 10 years ago by viboes (previous) (diff)

comment:3 by viboes, 10 years ago

Description: modified (diff)

comment:4 by viboes, 10 years ago

Resolution: fixed
Status: assignedclosed

Merged from trunk [80949],[80950],[80956] in revision [80964]

Note: See TracTickets for help on using tickets.