|
Boost : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-07-09 10:23:43
Peter Dimov wrote:
> Vladimir Prus wrote:
> > Ok, I understand. I'm writing at the moment code like:
> > .......
> > (*casts)[make_pair(Type::FloatTy, Type::DoubleTy)] =
> > NM::FTOD;
> >
> > and I think I'd rather like to eliminate that (*casts) part, and
> > make_pair, but while assign library can eliminate (*casts), I'm not
> > sure it can do much about 'make_pair'. Or it can....?
>
> static void add_cast( Type x, Type y, NM nm )
> {
> (*casts)[ make_pair(x, y) ] = nm;
> }
>
> ?
That surely will work, but if I have a way to write
init(map) = Type::FloatTy, Type::DoubleTy, NM::FTOD,
......................
I'd sure use it. But until it's possible, 'add_cast' or even macros will do
for me.
- Volodya
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk