
On Fri, Aug 26, 2011 at 2:14 PM, Michael Powell
Okay, I'm not positive I fully understood the first question in the whole series of emails, only so far as to respond with our experience with boost::units so far. Now, I'm really very extremely positive I don't know the tangent we're on. Perhaps someone with more history and experience with boost::units could give us a run-down what the premise behind b::u is, maybe a short primer, examples, what have you, just besides the user docs. which are fine, don't get me wrong, but might help to explain some misconceptions about what b::u is all about. Because I for one thought I knew, or at least still have a grasp of an idea, but wouldn't hurt for the newcomers. Thanks...
[Please don't top post]
The basic gist of the discussion is that many generic libraries don't
fully support Boost.Units because they don't support mixed type
arithmetic correctly (or aren't generic enough, however people want to
say it). Consider a very simple example of a hypothetical math
library function "add" that purports to handle user defined types
(some sort of BigInt is a popular example):
template <typename N>
N add(N lhs, N rhs)
{
return lhs + rhs;
}
Functions like this often break with Boost.Units because the result
type might not necessarily be the same as the argument types (N in
this case). Not only that, it doesn't allow adding two distinct types
together.
To define the function such that it would work with BigInt and
Boost.Units, it would have to be something like:
template