
On Thu, Dec 18, 2008 at 4:02 PM, John Phillips <phillips@mps.ohio-state.edu> wrote:
OvermindDL1 wrote:
And here is the Boost.MPL page of exactly that kind of example; it would give them their self-documentation, as well as being typesafe, as well as helping to make sure the programmer cannot screw up and start multiplying things together that they should not do and so forth (would throw a compile error, you know, instead of their internal logic silently breaking down):
http://www.boost.org/doc/libs/1_37_0/libs/mpl/doc/tutorial/dimensional-analy...
If he wants to include units, he could avoid writing his own using MPL, and instead use the already existing boost units library.
...I never noticed that there before. When I update it is usually only because of a library or two, and I had been using an MPL homegrown version in one of my apps since boost 1.34. I may have to convert some of my code to Boost.Units if it support multi-dimensional positions, could remove a few rather large headers that way... I was not saying he should use it (I doubt that the library headers would change it anyway), I was just using it as an example of a proper way to signify types, rather then using empty macros that can conflict with a huge amount of code, thus showing that what Boost is doing is correct, and what that header is doing is horribly wrong.