Physical constants support redesigned

This commit is contained in:
Mateusz Pusz
2020-03-17 17:13:18 +01:00
parent d2e49b25f7
commit 45888ac44e
4 changed files with 37 additions and 16 deletions
+4 -4
View File
@@ -42,12 +42,12 @@ void si_example()
using namespace si;
using GeV = gigaelectronvolt;
constexpr Velocity AUTO c = speed_of_light;
constexpr Velocity AUTO c = si2019::speed_of_light<>;
std::cout << "\n*** SI units (c = " << c << ") ***\n";
const Momentum AUTO p = 4.q_GeV / speed_of_light;
const Mass AUTO m = 3.q_GeV / pow<2>(speed_of_light);
const Momentum AUTO p = 4.q_GeV / c;
const Mass AUTO m = 3.q_GeV / pow<2>(c);
const Energy AUTO E = total_energy(p, m, c);
std::cout << "[in GeV]\n"
@@ -73,7 +73,7 @@ void natural_example()
using namespace natural;
using GeV = gigaelectronvolt;
constexpr Velocity AUTO c = speed_of_light;
constexpr Velocity AUTO c = speed_of_light<>;
const momentum<GeV> p(4);
const mass<GeV> m(3);
const Energy AUTO E = total_energy(p, m, c);