Modify

#12901 closed Bugs (fixed)

time_point.hpp includes <iostream> header

Reported by: Vyacheslav Lanovets <vyacheslav@…> Owned by: viboes
Milestone: Boost 1.65.0 Component: chrono
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

Inclusion of <iostream> via inclusion chain causes static global variable being linked into every translation unit. It causes numerous atexit() calls at startup and the processing at finish. The reason is the trick used by all major C++ Standard library developers - putting an instance with static visibility somewhere in iostream header.

This is a minor performance issue, but it also hinders investigation of startup and exit defects in an application. When developer sets breakpoint in the atexit in C runtime library, there is a lot of noise from iostream if there are many cpp files in the application.

There are several affected files in boost.chrono that have <iostream> included:

io\duration_io.hpp io\time_point_units.hpp process_cpu_clocks.hpp time_point.hpp

The reason is not very clear. Please, at least include more specific header, like <ostream>, if really needed.

Attachments (0)

Change History (3)

comment:2 Changed 12 months ago by viboes

Status: newassigned

comment:3 Changed 10 months ago by viboes

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.