
9 Jul
2004
9 Jul
'04
2:44 p.m.
Peter Dimov wrote:
That's nice! Do you have an equally simple recipe for std::map initialization?
For maps, I find the sequence of
m[ k ] = v;
good enough for my needs. A static array of pairs has about the same overhead per line:
{ k, v },
and dropping this down to just
k, v,
never seemed critical, considering the low frequency of single-place-hardcoded-init maps.
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....? - Volodya