Boost C++ Libraries: Ticket #6960: unnecessary dependency on boost.date_time when building with separate compilation https://svn.boost.org/trac10/ticket/6960 <p> The time_queue.hpp header file, in addition to defining the template, also defines one instantiation of it using boost::posix_time::ptime as the time type. This instantiation is then implemented in impl/timer_queue.ipp. This definition is only visible when building asio with the separate compilation option. </p> <p> If a client never uses the date_time ptime type, nor its clock, this results in an unnecessary dependency on boost.date_time (at least on windows, possibly because the gregorian::date_type constructor needs to be resolved at link-time). Simply commenting the extra instantiation solves the problem (i.e. removes the dependency on boost.date_time). </p> <p> I would suggest simply removing this explicit instantiation of the timer_queue template when building with separate compilation. From what I can tell, that would not cause any serious problems for any other use. Building with headers-only would not be affected at all, and building with separate compilation and actually using the boost::posix_time::ptime time_trait, it would just be instantiated automatically anyway, just like when using headers-only. </p> <p> I marked this as boost 1.46.0 because that's what I'm testing with on windows., but from what I can tell, this is still a problem in 1.49.0, since timer_queue_ptime.hpp is included in src.hpp </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6960 Trac 1.4.3 chris_kohlhoff Sun, 03 Jun 2012 09:59:22 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6960#comment:1 https://svn.boost.org/trac10/ticket/6960#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Is that a regression in boost.date_time? I believe it used to work without needing a library for these uses. </p> <p> The rationale for the timer_queue&lt;ptime&gt; specialisation is to minimise code duplication across object files / shared libraries. Removing it and relying on automatic template instantiation defeats that. </p> <p> However you can consider asio/impl/src.hpp as simply representing the default case for separate compilation. You can roll your own file that includes a minimal set of .ipp files as needed to resolve link dependencies. In more recent boost versions this would allow you to leave out timer_queue_ptime.ipp altogether. </p> <p> Note that a future version of asio will allow boost.date_time use to be disabled completely. </p> Ticket anonymous Thu, 28 Jun 2012 14:27:05 GMT <link>https://svn.boost.org/trac10/ticket/6960#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6960#comment:2</guid> <description> <p> It's not a regression in the sense that separate compilation didn't used be an option. But it is a regression in the sense that switching over to separate compilation changed behavior. </p> <p> I see your point that I could copy-paste src.hpp and pull out this one file. I'll do this, thanks! </p> <p> Maybe in the future the default deadline_timer in asio will use chrono even. </p> </description> <category>Ticket</category> </item> </channel> </rss>