Why class cannot be a key for a dictionary?

DeepDiverDeepDiver Thomas MuellerOrganization: Freelance Software DeveloperProject: Project depend on CustomersMember ✭✭✭
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

  • marcmarc FloridaMarc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications EngineAdministrators, ZeroC Staff ZeroC Staff
    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).
Sign In or Register to comment.