Units developers/users,

I need some advice. I am fairly confident boost::units is the way for us to go and support a design- or compile-time unit safe calculations environment. However, now for the tricky business of exposing that functionality to the rest of our application. I am in the midst of trying to do this by exposing some Managed C++ classes, plausibly representing each kind of dimension; to get started with I implemented a base Quantity class, and I am extending that to a Length. I would like to include a quantity<si::length> member, for starters, but I am receiving a build error:

Error    2    error C4368: cannot define 'si_l' as a member of managed 'CS::Boost::Units::Dimensions::Length': mixed types are not supported    c:\source\safetyvalve2011\cs.calculations.managed\units\Length.h    41    CS.Calculations.Managed

This might extend to include a quantity<us::length>, for instance; and so on for other unit systems.

Whatever .NET class we expose, this will act like the proxy between the application layer and the calculations layer; we might have Dimension-aware UI controls that work on Length, or Quantity, for instance. That sort of thing.

Anyone encountered anything like this before? Or have suggestions how we might overcome this hurdle?

I'm puzzling this one through in the meantime...

Thank you...

Regards,

Michael