refactor: IWYU applied to the source files

`alternative_namespaces` examples left out as I consider them a subject for removal in the nearest future.
This commit is contained in:
Mateusz Pusz
2021-03-30 13:21:05 +02:00
parent 01935996e6
commit 37cfc53d1d
163 changed files with 977 additions and 352 deletions

View File

@ -24,7 +24,6 @@
#include <units/isq/si/time.h>
#include <units/isq/si/typographic/length.h>
#include <units/isq/si/us/length.h>
#include <units/isq/si/volume.h>
#include <units/quantity_io.h>
#include <iostream>
@ -112,29 +111,29 @@ void calcs_comparison()
"when adding two values of the same very big\n"
"or very small type:\n\n";
length<femtometre,float> L1A = 2._q_fm;
length<femtometre,float> L2A = 3._q_fm;
length<femtometre,float> LrA = L1A + L2A;
fmt::print("{:%.30Q %q}\n + {:%.30Q %q}\n = {:%.30Q %q}\n\n",L1A,L2A,LrA);
length<femtometre, float> L1A = 2._q_fm;
length<femtometre, float> L2A = 3._q_fm;
length<femtometre, float> LrA = L1A + L2A;
fmt::print("{:%.30Q %q}\n + {:%.30Q %q}\n = {:%.30Q %q}\n\n", L1A, L2A, LrA);
std::cout << "The single unit method must convert large\n"
"or small values in other units to the base unit.\n"
"This is both inefficient and inaccurate\n\n";
length<metre,float> L1B = L1A;
length<metre,float> L2B = L2A;
length<metre,float> LrB = L1B + L2B;
fmt::print("{:%.30Q %q}\n + {:%.30Q %q}\n = {:%.30Q %q}\n\n",L1B,L2B,LrB);
length<metre, float> L1B = L1A;
length<metre, float> L2B = L2A;
length<metre, float> LrB = L1B + L2B;
fmt::print("{:%.30Q %q}\n + {:%.30Q %q}\n = {:%.30Q %q}\n\n", L1B, L2B, LrB);
std::cout << "In multiplication and division:\n\n";
area<square_femtometre,float> ArA = L1A * L2A;
fmt::print("{:%.30Q %q}\n * {:%.30Q %q}\n = {:%.30Q %q}\n\n",L1A,L2A,ArA);
area<square_femtometre, float> ArA = L1A * L2A;
fmt::print("{:%.30Q %q}\n * {:%.30Q %q}\n = {:%.30Q %q}\n\n", L1A, L2A, ArA);
std::cout << "similar problems arise\n\n";
area<square_metre,float> ArB = L1B * L2B;
fmt::print("{:%.30Q %q}\n * {:%.30Q %q}\n = {:%.30Q %q}\n\n",L1B,L2B,ArB);
area<square_metre, float> ArB = L1B * L2B;
fmt::print("{:%.30Q %q}\n * {:%.30Q %q}\n = {:%.30Q %q}\n\n", L1B, L2B, ArB);
}
} // namespace