I am trying to understand the dimensionality of the following two equations.
--- first equation --- example::types::radii_t val1 = 5 * example::types::radii; example::types::radii_t val2 = 4 * example::types::radii;
example::types::radii_t L1 = 1 / ( val1 - va2 );
va2->val2 This should give you a compile error anyway, since you are trying to assign a length to an inverse length...
If I was doing the dimensional analysis by hand I would see
1 / ( radii - radii )
Such that the end type would be
radii^-1
Given that end type here is the second equation:
example::types::radii_t val3 = 5 * example::types::radii; example::types::dimensionless_t val4 = 10; example::types::dimensionless_t L2 = L1 * val4 * val3;
Doing the dimensional analysis by hand I think I should see:
L2 = radii * (nothing) * radii^-1 = (nothing) or dimensionless
What Boost Units is reporting is that L2 is actually units in radii_t.
I'm not sure I believe you; the code you pasted is not compilable...did you actually compile anything?
--------- QUESTIONS --------------
Q1: How do you print out the types at compile time?
Q2: How can you confirm you have the correc power for a type? For example radii is indeed raised to the -1 power.
Using your earlier header :
#include "types.hpp"
#include <iostream>
#include