From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-12-21 10:19:14
"Andy Little" <andy_at_[hidden]> wrote
> Regarding using Typeof with compile time libraries such as mpl. mpl doesnt
> actually deal in types so when I operate on a mpl vector I might get back
> mpl::vector7 or something else. Similarly with mpl::math::rational I might
> back a mpl::math::rational or a mpl::math::simplified_rational.
> That makes for a very flakey quantities library unfortunately, because in
> compliant mode Typeof is totally dependent on implementation changes in
> other libraries, and when the compiler crashes because of unregistered
> does so in a huge fashion.
> Not sure what if anything can be done about it but I'm wondering whether
> worth asking library authors now to provide a mechanism so that user can
> register their libraries types (that would be eg a mpl::vector +++
> might turn into... is that possible or impractical? )without hassle. That
> solve my problem I think, but maybe would result in a type registration
Registering MPL types is a little less trivial than usual, because MPL
generates these types. Accordingly, registrations should also be generated,
but then we'd run into the problem with the __LINE__ usage. So, I think
this should utilize lower-level typeof macros, which do not use __LINE__,
but instead allow for Id to be specified directly.
> Any mechanism that allows use of Typeof without dependencies on
> details of other libraries would be appreciated!
I will try to implement such registrations for mpl::vector[n], as an
example. However, I think it's ultimately up to the library authors do
decide whether or not to make their libraries typeof-enabled (I would be
happy to provide any help on the subject).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk