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