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.
astronomic.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include "length.h"
15 #include "mass.h"
16 
17 namespace SI {
18 
24 template <typename _type>
26 template <typename _type>
28 template <typename _type>
30 
31 inline namespace literals {
32 
33 template <char... _digits>
34 constexpr astronomic_unit_t<int64_t> operator""_AU() {
36  SI::detail::parsing::Number<_digits...>::value};
37 }
38 
39 template <char... _digits> constexpr lightyear_t<int64_t> operator""_ly() {
40  return lightyear_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
41 }
42 
43 template <char... _digits> constexpr parsec_t<int64_t> operator""_pc() {
44  return parsec_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
45 }
46 
47 constexpr astronomic_unit_t<long double> operator""_AU(long double value) {
48  return astronomic_unit_t<long double>{value};
49 }
50 
51 constexpr lightyear_t<long double> operator""_ly(long double value) {
52  return lightyear_t<long double>{value};
53 }
54 
55 constexpr parsec_t<long double> operator""_pc(long double value) {
56  return parsec_t<long double>{value};
57 }
58 
59 } // namespace literals
60 
61 } // namespace SI
Definition: absorbed_dose.h:18
interface class for number
Definition: number_parser.h:111
base template class for holding values of type _type to be multiplied with a ratio _ratio
Definition: unit.h:51