annotate DEPENDENCIES/generic/include/boost/chrono/floor.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 // boost/chrono/round.hpp ------------------------------------------------------------//
Chris@16 2
Chris@16 3 // (C) Copyright Howard Hinnant
Chris@16 4 // Copyright 2011 Vicente J. Botet Escriba
Chris@16 5
Chris@16 6 // Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 7 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 8
Chris@16 9 // See http://www.boost.org/libs/chrono for documentation.
Chris@16 10
Chris@16 11 #ifndef BOOST_CHRONO_FLOOR_HPP
Chris@16 12 #define BOOST_CHRONO_FLOOR_HPP
Chris@16 13
Chris@16 14 #include <boost/chrono/duration.hpp>
Chris@16 15
Chris@16 16 namespace boost
Chris@16 17 {
Chris@16 18 namespace chrono
Chris@16 19 {
Chris@16 20
Chris@16 21 /**
Chris@16 22 * rounds down
Chris@16 23 */
Chris@16 24 template <class To, class Rep, class Period>
Chris@16 25 To floor(const duration<Rep, Period>& d)
Chris@16 26 {
Chris@101 27 To t = duration_cast<To>(d);
Chris@101 28 if (t>d) --t;
Chris@101 29 return t;
Chris@16 30 }
Chris@16 31
Chris@16 32
Chris@16 33 } // namespace chrono
Chris@16 34 } // namespace boost
Chris@16 35
Chris@16 36 #endif