Boost logo

Boost :

From: Robert Kawulak (kawulak_at_[hidden])
Date: 2005-10-18 04:28:29


Hi,

> From: Peder Holt

> > The problem is double_c is not a function object type - it
> only defines
> > operator value_type(). If it'd also define
> >
> > value_type operator() ()
> > {
> > return static_cast<value_type>(*this);
> > }
> >
>
> The mpl numerical holder classes already define a conversion operator,
> converting the held number to some native type defined by value_type.
> Would it not be possible to modify your library to use the conversion
> operator in stead?

Actually, after thinking the problem over, I've came to a conclusion that
it's not that bad idea :) I'll try to implement this, I think it may
simplify some things.

> > > To extract a runtime equivalent:
> > > boost::mpl::runtime_value<MinValGen::value_type>(MinValGen());
> >
> > There's something I don't understand - what does the above
> line do? I can't
> > see runtime_value having a constructor?
>
> Sorry. Typo.
> Should be:
> boost::mpl::runtime_value<MinValGen::value_type>()(MinValGen());
>
> Basically the same as: MinValGen::value_type(MinValGen()), except not
> all the types in mpl::math has a conversion operator (yet...)

Thanks for explanation. But could you tell what is runtime_value used for?

Best regards,
Robert


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk