[Boost-bugs] [Boost C++ Libraries] #12100: including <boost/accumulators/statistics/rolling_mean.hpp> brings static c++ initializers into my code

Subject: [Boost-bugs] [Boost C++ Libraries] #12100: including <boost/accumulators/statistics/rolling_mean.hpp> brings static c++ initializers into my code
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-03-26 22:17:50


#12100: including <boost/accumulators/statistics/rolling_mean.hpp> brings static
c++ initializers into my code
-------------------------------------------+--------------------------
 Reporter: Richard Powell <rmpowell77@…> | Owner: eric_niebler
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: accumulator
  Version: Boost 1.61.0 | Severity: Problem
 Keywords: |
-------------------------------------------+--------------------------
 At least I think so.

 If I
 #include <boost/accumulators/statistics/rolling_mean.hpp>

 Then I see that I have static variables that will need to be initialized.
 Because I want to include my code as a framework for other projects, we
 have a policy of avoiding having static initializers run (because of
 dynamic linkage).

 I believe the issue is with the extractors:

    namespace extract
    {
       extractor<tag::lazy_rolling_mean> const lazy_rolling_mean = {};
       extractor<tag::immediate_rolling_mean> const immediate_rolling_mean
 = {};
       extractor<tag::rolling_mean> const rolling_mean = {};

       BOOST_ACCUMULATORS_IGNORE_GLOBAL(lazy_rolling_mean)
          BOOST_ACCUMULATORS_IGNORE_GLOBAL(immediate_rolling_mean)
          BOOST_ACCUMULATORS_IGNORE_GLOBAL(rolling_mean)
    }

    using extract::lazy_rolling_mean;
    using extract::immediate_rolling_mean;
    using extract::rolling_mean;

 I think lazy_rolling_mean is the issue.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12100>
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-02-16 18:50:19 UTC