[C++-sig] len(list())?

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Wed Jul 3 15:34:04 CEST 2002


--- David Abrahams <david.abrahams at rcn.com> wrote:
> It works if you substitute "object" for "dictionary", as I suggested.

Yes, indeed. Thanks.

The context:

        // restore the object's __dict__
        object odict(mydict);
        object pdict(state_[0]);
        list pkeys(dictionary(mydict).keys());
        for(std::size_t i=0;i<len(pkeys);i++) {
          odict[pkeys[i]] = pdict[pkeys[i]];
        }

What can be said about

odict[pkeys[i]] = pdict[pkeys[i]];

versus

object k(pkeys[i]);
odict[k] = pdict[k];

Thanks,
        Ralf


__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com





More information about the Cplusplus-sig mailing list