Void pointers

Alex via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 17 10:43:46 PDT 2016


On Tuesday, 17 May 2016 at 17:25:48 UTC, ag0aep6g wrote:
> On 05/17/2016 05:33 PM, Alex wrote:
>> But, if the slicing is made by means of iota, there is no (at 
>> least no
>> explicit) dependence between the slices, which could be made by
>> different objects.
>
> How is this dependency expressed with slices?

By using the single source of slicing, which is the void* or a 
pre-instantiated iota with the maximum number.

>
>> I'm ready to admit, that the process will work with independent
>> slicing... In this case, I can omit my void* at all. So, the 
>> objects,
>> which make slices, don't do this from some object, they do 
>> this just by
>> calling iota. But this is little bit contra intuitive, as I 
>> imply a
>> relationship between the sliced parts.
>
> I'm not sure if I understand.
>
> Is the object the void pointer of the slice? If so, you start 
> the slicing from a null pointer, right? There is no real 
> relationship or dependency between the slices then.
>
> Or is the object some class/struct instance that creates a 
> slice? If so, how does it leave a reference to itself in the 
> slice?

Here, I'm not sure if I understand the question.
The relation is: some object A contains the pointer/iota/(if at 
all)
some object B makes slices of the thing, which is in A.


More information about the Digitalmars-d-learn mailing list