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_capacity.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_charge.h"
19 #include "electric_potential.h"
20 
21 namespace SI {
22 template <typename _type, class _ratio = std::ratio<1>>
24 
26 template <typename _type>
28 template <typename _type>
30 template <typename _type>
32 template <typename _type>
34 template <typename _type>
36 template <typename _type>
38 template <typename _type>
40 template <typename _type>
42 template <typename _type>
44 template <typename _type>
46 template <typename _type>
48 template <typename _type>
50 template <typename _type>
52 
53 // specialize unit_symbol for usage with stream operators
54 template <>
55 struct unit_symbol<'C', std::ratio<1>> : SI::detail::unit_symbol_impl<'F'> {};
56 
57 template <typename _ratio>
58 struct unit_symbol<'C', _ratio>
59  : SI::detail::unit_symbol_impl<SI::detail::ratio_prefix<_ratio>::value,
60  'F'> {};
61 
62 namespace detail {
65 } // namespace detail
66 
67 inline namespace literals {
68 template <char... _digits> constexpr atto_farad_t<int64_t> operator""_aF() {
69  return atto_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
70 }
71 
72 template <char... _digits> constexpr femto_farad_t<int64_t> operator""_fF() {
73  return femto_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
74 }
75 
76 template <char... _digits> constexpr pico_farad_t<int64_t> operator""_pF() {
77  return pico_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
78 }
79 
80 template <char... _digits> constexpr nano_farad_t<int64_t> operator""_nF() {
81  return nano_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
82 }
83 
84 template <char... _digits> constexpr micro_farad_t<int64_t> operator""_uF() {
85  return micro_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
86 }
87 
88 template <char... _digits> constexpr milli_farad_t<int64_t> operator""_mF() {
89  return milli_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
90 }
91 
92 template <char... _digits> constexpr farad_t<int64_t> operator""_F() {
93  return farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
94 }
95 
96 template <char... _digits> constexpr kilo_farad_t<int64_t> operator""_kF() {
97  return kilo_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
98 }
99 
100 template <char... _digits> constexpr mega_farad_t<int64_t> operator""_MF() {
101  return mega_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
102 }
103 
104 template <char... _digits> constexpr giga_farad_t<int64_t> operator""_GF() {
105  return giga_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
106 }
107 
108 template <char... _digits> constexpr tera_farad_t<int64_t> operator""_TF() {
109  return tera_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
110 }
111 
112 template <char... _digits> constexpr peta_farad_t<int64_t> operator""_PF() {
113  return peta_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
114 }
115 
116 template <char... _digits> constexpr exa_farad_t<int64_t> operator""_EF() {
117  return exa_farad_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
118 }
119 
120 constexpr atto_farad_t<long double> operator""_aF(long double value) {
121  return atto_farad_t<long double>{value};
122 }
123 
124 constexpr femto_farad_t<long double> operator""_fF(long double value) {
125  return femto_farad_t<long double>{value};
126 }
127 
128 constexpr pico_farad_t<long double> operator""_pF(long double value) {
129  return pico_farad_t<long double>{value};
130 }
131 
132 constexpr nano_farad_t<long double> operator""_nF(long double value) {
133  return nano_farad_t<long double>{value};
134 }
135 
136 constexpr micro_farad_t<long double> operator""_uF(long double value) {
137  return micro_farad_t<long double>{value};
138 }
139 
140 constexpr milli_farad_t<long double> operator""_mF(long double value) {
141  return milli_farad_t<long double>{value};
142 }
143 
144 constexpr farad_t<long double> operator""_F(long double value) {
145  return farad_t<long double>{value};
146 }
147 
148 constexpr kilo_farad_t<long double> operator""_kF(long double value) {
149  return kilo_farad_t<long double>{value};
150 }
151 
152 constexpr mega_farad_t<long double> operator""_MF(long double value) {
153  return mega_farad_t<long double>{value};
154 }
155 
156 constexpr giga_farad_t<long double> operator""_GF(long double value) {
157  return giga_farad_t<long double>{value};
158 }
159 
160 constexpr tera_farad_t<long double> operator""_TF(long double value) {
161  return tera_farad_t<long double>{value};
162 }
163 
164 constexpr peta_farad_t<long double> operator""_PF(long double value) {
165  return peta_farad_t<long double>{value};
166 }
167 
168 constexpr exa_farad_t<long double> operator""_EF(long double value) {
169  return exa_farad_t<long double>{value};
170 }
171 
172 } // namespace literals
173 } // namespace SI
BUILD_UNIT_FROM_DIVISION(electric_conductance_t, electric_current_t, electric_potential_t) template< typename _type
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