Void pointers

Alex via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 16 15:53:44 PDT 2016


On Monday, 16 May 2016 at 22:30:38 UTC, ag0aep6g wrote:
> On 05/16/2016 11:33 PM, Alex wrote:
>> Well... not wanting to have a variable, which stores numbers, 
>> which are
>> natural numbers, beginning with zero, used for counting only.
>
> But you have such a variable: b. I may still be missing the 
> point.

Yeah, the b variable is contained in the E objects and is 
unavoidable, as the E object has to save the region he is at and 
some number has to be reported by the E object to the describing 
objects in case of an action.
The point is, that the slice of numbers, contained in the E 
object is done from nothing. Well, from a void pointer. So, I get 
ordinal numbers from void and not from a list.
Just as the reality (in my head) is: you can count something 
without having written the natural numbers before you start to 
count... Especially, I don't have to create some strange structs 
containing just a number, as I expect to have some millions of 
them.


More information about the Digitalmars-d-learn mailing list