linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luciano Moreira - igLnx <lucianolnx@ig.com.br>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: STL - creating std::map key higher than double
Date: Tue, 26 Oct 2004 09:55:34 -0300	[thread overview]
Message-ID: <417E4946.6080001@ig.com.br> (raw)
In-Reply-To: <4176BF8E.5010107@ig.com.br>

Hi guys ! No aswers, no comments, no questions unil now.

I fixed the problem, if some one wants to know how, please contact me.

Regards,
Luciano

Luciano Moreira - igLnx escreveu:

> THE PROBLEM:
> I never created a map<> object that has a key different from embbeded 
> types. When I need a different key type, I create a union joinning my 
> type with a large enough embbed type. A sample:
> urion {
>      myObject X; // Its size is less or equal to double size;
>      double real_key;
> };
>
> Well, now I need a key larger than 128 bits, because it ll have about 
> 48 bytes. I tryed to create a map like as:
> typedef std::map<myKeyType, stItem, std::less< myKeyType > > tpList;
>
> But, off course, the compiler advised me that "less<>" cannot compare 
> "myKeyType", then I implemented a "operator<" into "myKeyType". And 
> now the problem is with "iterator".
>
> MY QUESTIONS:
> Does exist a way to get a map<> with a customized key ? Should I fix 
> the compiling erros, building my own objects ?
>
> Thanks,
> Luciano
>
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

      reply	other threads:[~2004-10-26 12:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-20 19:42 STL - creating std::map key higher than double Luciano Moreira - igLnx
2004-10-26 12:55 ` Luciano Moreira - igLnx [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=417E4946.6080001@ig.com.br \
    --to=lucianolnx@ig.com.br \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).