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.
electric_charge.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 #include "electric_current.h"
19 #include "time.h"
20 namespace SI {
21 
23 template <typename _type, typename _ratio>
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<'Q', std::ratio<1>> : SI::detail::unit_symbol_impl<'C'> {};
57 
58 template <typename _ratio>
59 struct unit_symbol<'Q', _ratio>
60  : SI::detail::unit_symbol_impl<SI::detail::ratio_prefix<_ratio>::value,
61  'C'> {};
62 
63 namespace detail {
65 }
66 
67 inline namespace literals {
68 
69 template <char... _digits> constexpr atto_coulomb_t<int64_t> operator""_aC() {
71  SI::detail::parsing::Number<_digits...>::value};
72 }
73 
74 template <char... _digits> constexpr femto_coulomb_t<int64_t> operator""_fC() {
76  SI::detail::parsing::Number<_digits...>::value};
77 }
78 
79 template <char... _digits> constexpr pico_coulomb_t<int64_t> operator""_pC() {
81  SI::detail::parsing::Number<_digits...>::value};
82 }
83 
84 template <char... _digits> constexpr nano_coulomb_t<int64_t> operator""_nC() {
86  SI::detail::parsing::Number<_digits...>::value};
87 }
88 
89 template <char... _digits> constexpr micro_coulomb_t<int64_t> operator""_uC() {
91  SI::detail::parsing::Number<_digits...>::value};
92 }
93 
94 template <char... _digits> constexpr milli_coulomb_t<int64_t> operator""_mC() {
96  SI::detail::parsing::Number<_digits...>::value};
97 }
98 
99 template <char... _digits> constexpr coulomb_t<int64_t> operator""_C() {
100  return coulomb_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
101 }
102 
103 template <char... _digits> constexpr kilo_coulomb_t<int64_t> operator""_kC() {
105  SI::detail::parsing::Number<_digits...>::value};
106 }
107 
108 template <char... _digits> constexpr mega_coulomb_t<int64_t> operator""_MC() {
110  SI::detail::parsing::Number<_digits...>::value};
111 }
112 
113 template <char... _digits> constexpr giga_coulomb_t<int64_t> operator""_GC() {
115  SI::detail::parsing::Number<_digits...>::value};
116 }
117 
118 template <char... _digits> constexpr tera_coulomb_t<int64_t> operator""_TC() {
120  SI::detail::parsing::Number<_digits...>::value};
121 }
122 
123 template <char... _digits> constexpr peta_coulomb_t<int64_t> operator""_PC() {
125  SI::detail::parsing::Number<_digits...>::value};
126 }
127 
128 template <char... _digits> constexpr exa_coulomb_t<int64_t> operator""_EC() {
129  return exa_coulomb_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
130 }
131 
132 constexpr atto_coulomb_t<long double> operator""_aC(long double value) {
133  return atto_coulomb_t<long double>{value};
134 }
135 
136 constexpr femto_coulomb_t<long double> operator""_fC(long double value) {
137  return femto_coulomb_t<long double>{value};
138 }
139 
140 constexpr pico_coulomb_t<long double> operator""_pC(long double value) {
141  return pico_coulomb_t<long double>{value};
142 }
143 
144 constexpr nano_coulomb_t<long double> operator""_nC(long double value) {
145  return nano_coulomb_t<long double>{value};
146 }
147 
148 constexpr micro_coulomb_t<long double> operator""_uC(long double value) {
149  return micro_coulomb_t<long double>{value};
150 }
151 
152 constexpr milli_coulomb_t<long double> operator""_mC(long double value) {
153  return milli_coulomb_t<long double>{value};
154 }
155 
156 constexpr coulomb_t<long double> operator""_C(long double value) {
157  return coulomb_t<long double>{value};
158 }
159 
160 constexpr kilo_coulomb_t<long double> operator""_kC(long double value) {
161  return kilo_coulomb_t<long double>{value};
162 }
163 
164 constexpr mega_coulomb_t<long double> operator""_MC(long double value) {
165  return mega_coulomb_t<long double>{value};
166 }
167 
168 constexpr giga_coulomb_t<long double> operator""_GC(long double value) {
169  return giga_coulomb_t<long double>{value};
170 }
171 
172 constexpr tera_coulomb_t<long double> operator""_TC(long double value) {
173  return tera_coulomb_t<long double>{value};
174 }
175 
176 constexpr peta_coulomb_t<long double> operator""_PC(long double value) {
177  return peta_coulomb_t<long double>{value};
178 }
179 
180 constexpr exa_coulomb_t<long double> operator""_EC(long double value) {
181  return exa_coulomb_t<long double>{value};
182 }
183 
184 } // namespace literals
185 } // namespace SI
Definition: absorbed_dose.h:18
#define BUILD_UNIT_FROM_MULTIPLICATION(RESULTING_UNIT, UNIT_LHS, UNIT_RHS)
Definition: operator_helpers.h:54
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