SI  2.5.4
A header only c++ library that provides type safety and user defined literals for handling physical values defined in the International System of Units.
radioactivity.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include "detail/number_parser.h"
16 #include "detail/unit.h"
17 #include "detail/unit_symbol.h"
18 namespace SI {
19 
23 template <typename _type, class _ratio = std::ratio<1>>
25 
27 template <typename _type>
29 template <typename _type>
31 template <typename _type>
33 template <typename _type>
35 template <typename _type>
37 template <typename _type>
39 template <typename _type>
41 template <typename _type>
43 template <typename _type>
45 template <typename _type>
47 template <typename _type>
49 template <typename _type>
51 template <typename _type>
53 
54 // specialize unit_symbol for usage with stream operators
55 template <>
56 struct unit_symbol<'A', std::ratio<1>>
57  : SI::detail::unit_symbol_impl<'B', 'q'> {};
58 
59 template <typename _ratio>
60 struct unit_symbol<'A', _ratio>
61  : SI::detail::unit_symbol_impl<SI::detail::ratio_prefix<_ratio>::value, 'B',
62  'q'> {};
63 
64 inline namespace literals {
65 template <char... _digits>
66 constexpr atto_becquerel_t<int64_t> operator""_aBq() {
68  SI::detail::parsing::Number<_digits...>::value};
69 }
70 
71 template <char... _digits>
72 constexpr femto_becquerel_t<int64_t> operator""_fBq() {
74  SI::detail::parsing::Number<_digits...>::value};
75 }
76 
77 template <char... _digits>
78 constexpr pico_becquerel_t<int64_t> operator""_pBq() {
80  SI::detail::parsing::Number<_digits...>::value};
81 }
82 
83 template <char... _digits>
84 constexpr nano_becquerel_t<int64_t> operator""_nBq() {
86  SI::detail::parsing::Number<_digits...>::value};
87 }
88 
89 template <char... _digits>
90 constexpr micro_becquerel_t<int64_t> operator""_uBq() {
92  SI::detail::parsing::Number<_digits...>::value};
93 }
94 
95 template <char... _digits>
96 constexpr milli_becquerel_t<int64_t> operator""_mBq() {
98  SI::detail::parsing::Number<_digits...>::value};
99 }
100 
101 template <char... _digits> constexpr becquerel_t<int64_t> operator""_Bq() {
102  return becquerel_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
103 }
104 
105 template <char... _digits>
106 constexpr kilo_becquerel_t<int64_t> operator""_kBq() {
108  SI::detail::parsing::Number<_digits...>::value};
109 }
110 
111 template <char... _digits>
112 constexpr mega_becquerel_t<int64_t> operator""_MBq() {
114  SI::detail::parsing::Number<_digits...>::value};
115 }
116 
117 template <char... _digits>
118 constexpr giga_becquerel_t<int64_t> operator""_GBq() {
120  SI::detail::parsing::Number<_digits...>::value};
121 }
122 
123 template <char... _digits>
124 constexpr tera_becquerel_t<int64_t> operator""_TBq() {
126  SI::detail::parsing::Number<_digits...>::value};
127 }
128 
129 template <char... _digits>
130 constexpr peta_becquerel_t<int64_t> operator""_PBq() {
132  SI::detail::parsing::Number<_digits...>::value};
133 }
134 
135 template <char... _digits> constexpr exa_becquerel_t<int64_t> operator""_EBq() {
137  SI::detail::parsing::Number<_digits...>::value};
138 }
139 
140 constexpr atto_becquerel_t<long double> operator""_aBq(long double value) {
141  return atto_becquerel_t<long double>{value};
142 }
143 
144 constexpr femto_becquerel_t<long double> operator""_fBq(long double value) {
145  return femto_becquerel_t<long double>{value};
146 }
147 
148 constexpr pico_becquerel_t<long double> operator""_pBq(long double value) {
149  return pico_becquerel_t<long double>{value};
150 }
151 
152 constexpr nano_becquerel_t<long double> operator""_nBq(long double value) {
153  return nano_becquerel_t<long double>{value};
154 }
155 
156 constexpr micro_becquerel_t<long double> operator""_uBq(long double value) {
157  return micro_becquerel_t<long double>{value};
158 }
159 
160 constexpr milli_becquerel_t<long double> operator""_mBq(long double value) {
161  return milli_becquerel_t<long double>{value};
162 }
163 
164 constexpr becquerel_t<long double> operator""_Bq(long double value) {
165  return becquerel_t<long double>{value};
166 }
167 
168 constexpr kilo_becquerel_t<long double> operator""_kBq(long double value) {
169  return kilo_becquerel_t<long double>{value};
170 }
171 
172 constexpr mega_becquerel_t<long double> operator""_MBq(long double value) {
173  return mega_becquerel_t<long double>{value};
174 }
175 
176 constexpr giga_becquerel_t<long double> operator""_GBq(long double value) {
177  return giga_becquerel_t<long double>{value};
178 }
179 
180 constexpr tera_becquerel_t<long double> operator""_TBq(long double value) {
181  return tera_becquerel_t<long double>{value};
182 }
183 
184 constexpr peta_becquerel_t<long double> operator""_PBq(long double value) {
185  return peta_becquerel_t<long double>{value};
186 }
187 
188 constexpr exa_becquerel_t<long double> operator""_EBq(long double value) {
189  return exa_becquerel_t<long double>{value};
190 }
191 
192 } // namespace literals
193 } // namespace SI
Definition: absorbed_dose.h:18
interface class for number
Definition: number_parser.h:111
Compile time string provider for conversion of unit types to strings.
Definition: unit_symbol.h:21
base template class for holding values of type _type to be multiplied with a ratio _ratio
Definition: unit.h:51
Base struct. Unusable needs template overloading.
Definition: unit_symbol.h:64