Skip to content

Commit

Permalink
Merge pull request #86 from bernedom/feature/literals-for-ton
Browse files Browse the repository at this point in the history
Feature/literals for ton
  • Loading branch information
bernedom authored Feb 10, 2021
2 parents 0ee820a + 05018d6 commit 417e517
Show file tree
Hide file tree
Showing 42 changed files with 140 additions and 40 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.4

* Add literals for ton types up to peta ton

## 2.0.3

* Add synonymous `*_ton_t` types for mass magnitudes
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)

project(
"SI"
VERSION 2.0.3
VERSION 2.0.4
DESCRIPTION
"A header only c++ library that provides type safety and user defined literals for handling pyhsical values defined in the International System of Units."
HOMEPAGE_URL "https://github.com/bernedom/SI"
Expand Down
2 changes: 1 addition & 1 deletion include/SI/absorbed_dose.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/acceleration.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/angle.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/area.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/astronomic.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/catalytic_activity.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/detail/detail.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/detail/number_parser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/detail/operator_helpers.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/detail/unit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/detail/unit_symbol.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/electric_capacity.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/electric_charge.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/electric_conductance.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/electric_current.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/electric_potential.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/electric_resistance.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/energy.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/equivalent_dose.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/force.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/frequency.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/illuminance.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/inductance.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/length.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/luminosity.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/luminous_flux.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/magnetic_field.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/magnetic_flux.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
42 changes: 41 additions & 1 deletion include/SI/mass.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down Expand Up @@ -99,6 +99,26 @@ template <char... _digits> constexpr ton_t<int64_t> operator""_t() {
return ton_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
}

template <char... _digits> constexpr kilo_ton_t<int64_t> operator""_kt() {
return kilo_ton_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
}

template <char... _digits> constexpr mega_ton_t<int64_t> operator""_Mt() {
return mega_ton_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
}

template <char... _digits> constexpr giga_ton_t<int64_t> operator""_Gt() {
return giga_ton_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
}

template <char... _digits> constexpr tera_ton_t<int64_t> operator""_Tt() {
return tera_ton_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
}

template <char... _digits> constexpr peta_ton_t<int64_t> operator""_Pt() {
return peta_ton_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
}

template <char... _digits> constexpr mega_gram_t<int64_t> operator""_Mg() {
return mega_gram_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
}
Expand Down Expand Up @@ -155,6 +175,26 @@ constexpr ton_t<long double> operator"" _t(long double t) {
return ton_t<long double>(t);
}

constexpr kilo_ton_t<long double> operator"" _kt(long double t) {
return kilo_ton_t<long double>(t);
}

constexpr mega_ton_t<long double> operator"" _Mt(long double t) {
return mega_ton_t<long double>(t);
}

constexpr giga_ton_t<long double> operator"" _Gt(long double t) {
return giga_ton_t<long double>(t);
}

constexpr tera_ton_t<long double> operator"" _Tt(long double t) {
return tera_ton_t<long double>(t);
}

constexpr peta_ton_t<long double> operator"" _Pt(long double t) {
return peta_ton_t<long double>(t);
}

constexpr mega_gram_t<long double> operator""_Mg(long double value) {
return mega_gram_t<long double>{value};
}
Expand Down
2 changes: 1 addition & 1 deletion include/SI/momentum.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/power.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/pressure.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/radioactivity.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/solid_angle.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/stream.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/substance.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/temperature.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/time.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
2 changes: 1 addition & 1 deletion include/SI/velocity.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of "SI" version 2.0.3
* This file is part of "SI" version 2.0.4
* A header only c++ library that provides type safety and user defined literals
* for handling pyhsical values defined in the International System of
* Units
Expand Down
Loading

0 comments on commit 417e517

Please sign in to comment.