Results 1 to 2 of 2

Thread: Why class cannot be a key for a dictionary?

  1. #1
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105

    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
    Thomas Müller, Freelance Software Developer
    My profil on www.freelancermap.de
    My Profile on Xing
    Projects depend on customers

  2. #2
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    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).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. C++ mapping for a dictionary with an enum as the key
    By mefoster in forum Help Center
    Replies: 3
    Last Post: 10-14-2009, 10:38 AM
  2. IceSSL::PublicKey key() member accessibility
    By paolo in forum Bug Reports
    Replies: 1
    Last Post: 08-30-2007, 11:00 PM
  3. IceSSL CA public key and C#
    By tkrieger in forum Help Center
    Replies: 1
    Last Post: 12-08-2006, 10:53 PM
  4. C# and dictionary/sequence problem on ICE 3.0.1
    By tkrieger in forum Help Center
    Replies: 2
    Last Post: 05-18-2006, 12:59 PM
  5. Dictionary mapping in cpp
    By DeepDiver in forum Comments
    Replies: 1
    Last Post: 04-07-2005, 08:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •