void[] vs byte[]

BCS none at anon.com
Sat Aug 28 13:13:28 PDT 2010


Hello Yao G.,

> I'm here with another n00b question:
> 
> When dealing with big buffers (or files), which is better to use as
> storage? void[] or byte[]?

If the data may contain pointers into the heap, use void[] if it will not 
use byte[]. byte[] is "raw" data, void[] is anything at all.


> 
> What are the advantages and disadvantages of each one? I've seen that
> void[] is used in some Phobos modules, like std.zlib, and in other
> modules  the choice is byte[] (chunk in std.stdio).
> 
> Is there a place where this stuff is documented? Or choosing one or
> another is just a matter of preference and the differences are
> trivial?
> 
> Thanks in advance.
> 
-- 
... <IXOYE><





More information about the Digitalmars-d-learn mailing list