Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/chrono/ceil.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //  boost/chrono/round.hpp  ------------------------------------------------------------//
0002 
0003 //  (C) Copyright Howard Hinnant
0004 //  Copyright 2011 Vicente J. Botet Escriba
0005 
0006 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
0007 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 //  See http://www.boost.org/libs/chrono for documentation.
0010 
0011 #ifndef BOOST_CHRONO_CEIL_HPP
0012 #define BOOST_CHRONO_CEIL_HPP
0013 
0014 #include <boost/chrono/duration.hpp>
0015 
0016 namespace boost
0017 {
0018   namespace chrono
0019   {
0020 
0021     /**
0022      * rounds up
0023      */
0024     template <class To, class Rep, class Period>
0025     To ceil(const duration<Rep, Period>& d)
0026     {
0027         To t = duration_cast<To>(d);
0028         if (t < d)
0029             ++t;
0030         return t;
0031     }
0032 
0033   } // namespace chrono
0034 } // namespace boost
0035 
0036 #endif