From ad3bb9bbab1944408b0d013d2d04984f29daaa2b Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Wed, 14 Sep 2016 19:27:53 +1000 Subject: [PATCH] Include the cmath header for std::lround. Fix spaces before parens for style guide. --- include/pybind11/chrono.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/pybind11/chrono.h b/include/pybind11/chrono.h index 58ecb06d3..110031e29 100644 --- a/include/pybind11/chrono.h +++ b/include/pybind11/chrono.h @@ -11,6 +11,7 @@ #pragma once #include "pybind11.h" +#include #include #include @@ -26,7 +27,7 @@ public: using namespace std::chrono; // Lazy initialise the PyDateTime import - if(!PyDateTimeAPI) { PyDateTime_IMPORT; } + if (!PyDateTimeAPI) { PyDateTime_IMPORT; } if (!src) return false; // If they have passed us a datetime.delta object @@ -52,7 +53,7 @@ public: static handle cast(const std::chrono::duration &src, return_value_policy /* policy */, handle /* parent */) { using namespace std::chrono; - if(!PyDateTimeAPI) { PyDateTime_IMPORT; } + if (!PyDateTimeAPI) { PyDateTime_IMPORT; } // Declare these special duration types so the conversions happen with the correct primitive types (int) using dd_t = duration>; @@ -75,7 +76,7 @@ public: using namespace std::chrono; // Lazy initialise the PyDateTime import - if(!PyDateTimeAPI) { PyDateTime_IMPORT; } + if (!PyDateTimeAPI) { PyDateTime_IMPORT; } if (!src) return false; if (PyDateTime_Check(src.ptr())) { @@ -98,7 +99,7 @@ public: using namespace std::chrono; // Lazy initialise the PyDateTime import - if(!PyDateTimeAPI) { PyDateTime_IMPORT; } + if (!PyDateTimeAPI) { PyDateTime_IMPORT; } time_t tt = system_clock::to_time_t(src); // this function uses static memory so it's best to copy it out asap just in case @@ -129,7 +130,7 @@ public: bool load(handle src, bool) { using namespace std::chrono; - if(!PyDateTimeAPI) { PyDateTime_IMPORT; } + if (!PyDateTimeAPI) { PyDateTime_IMPORT; } // If they have passed us a datetime.delta object if (PyDelta_Check(src.ptr())) { @@ -155,7 +156,7 @@ public: using namespace std::chrono; // Lazy initialise the PyDateTime import - if(!PyDateTimeAPI) { PyDateTime_IMPORT; } + if (!PyDateTimeAPI) { PyDateTime_IMPORT; } // Declare these special duration types so the conversions happen with the correct primitive types (int) using dd_t = duration>;