Archived

This forum has been archived. Please start a new discussion on GitHub.

Why class cannot be a key for a dictionary?

hi zeroc,

just one quick question:

Why class cannot be a key for a dictionary?

as long as the class is used as a value type i think it shall work.

thx tom

Comments

  • marc
    marc Florida
    Because classes support inheritance, they could potentially contain anything, including other maps, or floating point types, both of which are not suitable as dictionary keys (at least not for all language mappings).