Conceptually, it seems to me that using single forced types (Meters, Seconds, Kilograms) will have enormous advantages (additional checking when passing args, getting rid of unit names in vars, etc.), and yet I have not come across as much code which does. And the code I saw that used used custom types.
I see that boost has a library of units (boost :: units is enough), and yet I donโt see much evidence that it is widely used (mainly Google search).
Is there a good reason for this?
Together, they apparently mean that there must be some reason why the practice was not as widely accepted as I expected. Perhaps more problems than they are for some reason?
And so I ask:
Is there a reason not to use enforcement elements? In particular, is there a reason not to use boost :: units?
source share