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.
Loading...
Searching...
No Matches
astronomic.h
Go to the documentation of this file.
1
12#pragma once
13
14#include "length.h"
15#include "mass.h"
16
17namespace SI {
18
24template <typename _type>
26template <typename _type>
28template <typename _type>
30
31inline namespace literals {
32
33template <char... _digits>
34constexpr astronomic_unit_t<int64_t> operator""_AU() {
36 SI::detail::parsing::Number<_digits...>::value};
37}
38
39template <char... _digits> constexpr lightyear_t<int64_t> operator""_ly() {
40 return lightyear_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
41}
42
43template <char... _digits> constexpr parsec_t<int64_t> operator""_pc() {
44 return parsec_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
45}
46
47constexpr astronomic_unit_t<long double> operator""_AU(long double value) {
49}
50
51constexpr lightyear_t<long double> operator""_ly(long double value) {
52 return lightyear_t<long double>{value};
53}
54
55constexpr 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