Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #11497

Re: Special Data Type Declaration and Usage

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Special Data Type Declaration and Usage
Date Wed, 16 Nov 2011 11:51:26 +1300
Lines 19
Message-ID <9ig8nfFi5oU9@mid.individual.net> (permalink)
References <MPG.292c81c3a91936999896cd@news.eternal-september.org> <slrnjc5pc2.1bk.grahn+nntp@frailea.sa.invalid>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net ZG7yIO/sV32UtEVHMk88/g09Yi+85X5aoYQXLKDvTsTIVhUGCU
Cancel-Lock sha1:F4c9rNZvTSzt3MbAS6HYtrNCio4=
User-Agent Mozilla/5.0 (X11; SunOS i86pc; rv:6.0.2) Gecko/20111003 Thunderbird/6.0.2
In-Reply-To <slrnjc5pc2.1bk.grahn+nntp@frailea.sa.invalid>
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:11497

Show key headers only | View raw


On 11/16/11 11:19 AM, Jorgen Grahn wrote:
> On Tue, 2011-11-15, Mike Copeland wrote:
>>     I need to declare an enormous array (100,000 members) of a small
>> scalar object, and I want to populate it with default values and change
>> some of them as needed throughout the processing.
>
> Why does it have to be an array?  It would be easier to handle this if
> you could create a class MyBundleOf100000SmallThings and use one of
> those.  Internally you may pack them into a std::vector<unsigned char>
> or something. You won't easily be able to say
>
>    enormous[4711] = 2;
>
> though, although you can easily /read/ from it using that syntax.

Both operators are possible through the use of a simple proxy object.

-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Special Data Type Declaration and Usage mrc2323@cox.net (Mike Copeland) - 2011-11-15 14:04 -0700
  Re: Special Data Type Declaration and Usage Ian Collins <ian-news@hotmail.com> - 2011-11-16 10:09 +1300
  Re: Special Data Type Declaration and Usage "Gennaro Prota" <gennaro.prota+Usenet@gmail.com> - 2011-11-15 22:16 +0100
    Re: Special Data Type Declaration and Usage mrc2323@cox.net (Mike Copeland) - 2011-11-15 14:30 -0700
      Re: Special Data Type Declaration and Usage Ian Collins <ian-news@hotmail.com> - 2011-11-16 10:36 +1300
        Re: Special Data Type Declaration and Usage mrc2323@cox.net (Mike Copeland) - 2011-11-15 15:02 -0700
          Re: Special Data Type Declaration and Usage Victor Bazarov <v.bazarov@comcast.invalid> - 2011-11-15 18:10 -0500
      Re: Special Data Type Declaration and Usage "Gennaro Prota" <gennaro.prota+Usenet@gmail.com> - 2011-11-15 23:58 +0100
      Re: Special Data Type Declaration and Usage Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-16 06:42 -0800
        Re: Special Data Type Declaration and Usage Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-16 17:16 +0000
          Re: Special Data Type Declaration and Usage Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-17 00:04 -0800
  Re: Special Data Type Declaration and Usage Brian Drummond <brian@shapes.demon.co.uk> - 2011-11-15 22:17 +0000
  Re: Special Data Type Declaration and Usage Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-15 22:19 +0000
    Re: Special Data Type Declaration and Usage Ian Collins <ian-news@hotmail.com> - 2011-11-16 11:51 +1300
      Re: Special Data Type Declaration and Usage Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-16 00:27 +0000
  Re: Special Data Type Declaration and Usage Paavo Helde <myfirstname@osa.pri.ee> - 2011-11-15 16:28 -0600

csiph-web