BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl_ratio.h
Go to the documentation of this file.
1/// @file bslstl_ratio.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslstl_ratio.h -*-C++-*-
8#ifndef INCLUDED_BSLSTL_RATIO
9#define INCLUDED_BSLSTL_RATIO
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslstl_ratio bslstl_ratio
15/// @brief Provide functionality of the corresponding C++ Standard header.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslstl
19/// @{
20/// @addtogroup bslstl_ratio
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslstl_ratio-purpose"> Purpose</a>
25/// * <a href="#bslstl_ratio-description"> Description </a>
26///
27/// # Purpose {#bslstl_ratio-purpose}
28/// Provide functionality of the corresponding C++ Standard header.
29///
30/// **Canonical header:** bsl_ratio.h
31///
32/// @see package bos+stdhdrs in the bos package group
33///
34/// # Description {#bslstl_ratio-description}
35/// Provide types, in the `bsl` namespace, equivalent to those
36/// defined in the corresponding C++ standard header. Include the native
37/// compiler-provided standard header, and also directly include Bloomberg's
38/// implementation of the C++ standard type (if one exists). Finally, place the
39/// included symbols from the `std` namespace (if any) into the `bsl` namespace.
40/// @}
41/** @} */
42/** @} */
43
44/** @addtogroup bsl
45 * @{
46 */
47/** @addtogroup bslstl
48 * @{
49 */
50/** @addtogroup bslstl_ratio
51 * @{
52 */
53
54#include <bslscm_version.h>
55
57
58#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
59#include <bsls_nativestd.h>
60#endif // BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
61
62#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
63
64#include <ratio>
65
66namespace bsl {
67
68 using std::ratio;
69 using std::ratio_add;
70 using std::ratio_subtract;
71 using std::ratio_multiply;
72 using std::ratio_divide;
73 using std::ratio_equal;
74 using std::ratio_not_equal;
75 using std::ratio_less;
76 using std::ratio_less_equal;
77 using std::ratio_greater;
78 using std::ratio_greater_equal;
79 using std::atto;
80 using std::femto;
81 using std::pico;
82 using std::nano;
83 using std::micro;
84 using std::milli;
85 using std::centi;
86 using std::deci;
87 using std::deca;
88 using std::hecto;
89 using std::kilo;
90 using std::mega;
91 using std::giga;
92 using std::tera;
93 using std::peta;
94 using std::exa;
95#ifdef BSL_RATIO_SUPPORTS_EXTENDED_SI_TYPEDEFS
96 using std::yocto;
97 using std::zepto;
98 using std::zetta;
99 using std::yotta;
100#endif
101
102#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
103 using std::ratio_equal_v;
104 using std::ratio_not_equal_v;
105 using std::ratio_less_v;
106 using std::ratio_less_equal_v;
107 using std::ratio_greater_v;
108 using std::ratio_greater_equal_v;
109#elif defined BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY
110 template <class R1, class R2> constexpr bool ratio_equal_v
111 = ratio_equal<R1, R2>::value;
112 // This template variable represents the result value of the
113 // 'std::ratio_equal' meta-function.
114
115 template <class R1, class R2> constexpr bool ratio_not_equal_v
116 = ratio_not_equal<R1, R2>::value;
117 // This template variable represents the result value of the
118 // 'std::ratio_not_equal' meta-function.
119
120 template <class R1, class R2> constexpr bool ratio_less_v
121 = ratio_less<R1, R2>::value;
122 // This template variable represents the result value of the
123 // 'std::ratio_less' meta-function.
124
125 template <class R1, class R2> constexpr bool ratio_less_equal_v
126 = ratio_less_equal<R1, R2>::value;
127 // This template variable represents the result value of the
128 // 'std::ratio_less_equal' meta-function.
129
130 template <class R1, class R2> constexpr bool ratio_greater_v
131 = ratio_greater<R1, R2>::value;
132 // This template variable represents the result value of the
133 // 'std::ratio_greater' meta-function.
134
135 template <class R1, class R2> constexpr bool ratio_greater_equal_v
136 = ratio_greater_equal<R1, R2>::value;
137 // This template variable represents the result value of the
138 // 'std::ratio_greater_equal' meta-function.
139
140#endif
141} // close package namespace
142
143#endif // BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
144#endif
145
146// ----------------------------------------------------------------------------
147// Copyright 2018 Bloomberg Finance L.P.
148//
149// Licensed under the Apache License, Version 2.0 (the "License");
150// you may not use this file except in compliance with the License.
151// You may obtain a copy of the License at
152//
153// http://www.apache.org/licenses/LICENSE-2.0
154//
155// Unless required by applicable law or agreed to in writing, software
156// distributed under the License is distributed on an "AS IS" BASIS,
157// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
158// See the License for the specific language governing permissions and
159// limitations under the License.
160// ----------------------------- END-OF-FILE ----------------------------------
161
162/** @} */
163/** @} */
164/** @} */
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlb_printmethods.h:283