public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Branko Cibej <branko.cibej@hermes.si>
To: Andrew Borthwick <borthwic@johnson.cs.nyu.edu>
Cc: egcs@cygnus.com
Subject: Re: bool
Date: Wed, 12 Nov 1997 02:47:00 -0000	[thread overview]
Message-ID: <346988EE.DAA6E15C@hermes.si> (raw)
In-Reply-To: <Pine.GSO.3.92.971111180847.13267D-100000@johnson.cs.nyu.edu>

Andrew Borthwick wrote:

>     I'm still not entirely clear.  Am I correct that bit_vector gives me
> 1 bit per bool but vector<bool> does not?  If this is so, couldn't vector be
> easily specialized for vector<bool> to give this functionality in a more
> standard fashion?

    There was a long and heated debate about that some time ago in comp.std.c++. I
don't know what the status is now, but at that time the draft standard required
vector<bool> to be specialised so that it used one bit per bool, like bit_vector
does. The central problem was the very same space-vs.-time trade-off we have here.

Personally I think that having two different containers is the correct solution:
vector<bool> for fast access and bit_vector for compact storage -- and you can
always compromise with a vector<unsigned char>.

--
Branko Cibej   <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
phone: (++386 61) 186 53 49  fax: (++386 61) 186 52 70



  reply	other threads:[~1997-11-12  2:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-11 15:29 Andrew Borthwick
1997-11-12  2:47 ` Branko Cibej [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-11-11  8:27 bool Andrew Borthwick
1997-11-11 10:52 ` bool Per Bothner
     [not found] ` <199711111843.KAA03525.cygnus.egcs@cygnus.com>
1997-11-11 12:13   ` bool Jason Merrill
1997-11-11 12:28     ` bool Per Bothner
1997-11-11 18:24       ` bool Alexandre Oliva
     [not found]     ` <199711112028.MAA08953.cygnus.egcs@cygnus.com>
1997-11-11 18:44       ` bool Jason Merrill
1997-11-12  5:59         ` bool John Carr
1997-11-12  6:25           ` bool Torbjorn Granlund

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=346988EE.DAA6E15C@hermes.si \
    --to=branko.cibej@hermes.si \
    --cc=borthwic@johnson.cs.nyu.edu \
    --cc=egcs@cygnus.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).