Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument to boost microseconds must be integral in Boost >= 1.67 #79

Merged
merged 1 commit into from Jun 6, 2018

Conversation

lsolanka
Copy link
Contributor

With Boost >= 1.67 compilation of roscpp_core fails because boost now requires the
microseconds constructor argument to be integral.

The git diff boost-1.66.0 include/boost/date_time/time_duration.hpp in boost date_time git repository confirms that the constructor to boost::date_time::subsecond_duration was made more stringent:

@@ -278,14 +280,15 @@ namespace date_time {
     BOOST_STATIC_CONSTANT(boost::int64_t, adjustment_ratio = (traits_type::ticks_per_second >= frac_of_second ? traits_type::ticks_per_second / frac_of_second : frac_of_second / traits_type::ticks_per_second));
 
   public:
-    explicit subsecond_duration(boost::int64_t ss) :
+    // The argument (ss) must be an integral type
+    template <typename T>
+    explicit subsecond_duration(T const& ss,
+                                typename boost::enable_if<boost::is_integral<T>, void>::type* = 0) :
       base_duration(impl_type(traits_type::ticks_per_second >= frac_of_second ? ss * adjustment_ratio : ss / adjustment_ratio))
     {
     }
   };

The patch here simply makes it an integer, which should not make any difference, if I'm correct?

With Boost >= 1.67 compilation fails because now it requires the
constructor argument to be integral.
@dirk-thomas
Copy link
Member

dirk-thomas commented Jun 6, 2018

Thank you for the patch!

@dirk-thomas dirk-thomas merged commit 1ccd276 into ros:kinetic-devel Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants