AWS SDK for C++

AWS SDK for C++ Version 1.11.886

Loading...
Searching...
No Matches
Chrono.h
1
6#pragma once
7
8#include <chrono>
9
10// TODO: delete the fallback branch once the SDK's minimum standard is C++17.
11#if defined(__cpp_lib_chrono) && __cpp_lib_chrono >= 201510L
12
13namespace Aws
14{
15 namespace chrono
16 {
17 using std::chrono::abs;
18 }
19}
20
21#else
22
23#include <type_traits>
24#include <limits>
25
26namespace Aws
27{
28 namespace chrono
29 {
30 template <class Rep, class Period>
31 constexpr typename std::enable_if<std::numeric_limits<Rep>::is_signed,
32 std::chrono::duration<Rep, Period>>::type
33 abs(std::chrono::duration<Rep, Period> d)
34 {
35 return d >= d.zero() ? d : -d;
36 }
37 }
38}
39
40#endif
constexpr std::enable_if< std::numeric_limits< Rep >::is_signed, std::chrono::duration< Rep, Period > >::type abs(std::chrono::duration< Rep, Period > d)
Definition Chrono.h:33