[Boost-bugs] [Boost C++ Libraries] #12901: time_point.hpp includes <iostream> header

Subject: [Boost-bugs] [Boost C++ Libraries] #12901: time_point.hpp includes <iostream> header
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-13 16:37:07


#12901: time_point.hpp includes <iostream> header
------------------------------------------------+---------------------
 Reporter: Vyacheslav Lanovets <vyacheslav@…> | Owner: viboes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: chrono
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: |
------------------------------------------------+---------------------
 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12901>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-03-13 16:40:12 UTC