On Wed., 18 Apr. 2018, 8:36 pm Manu, <turkey...@gmail.com> wrote: > On Wed., 18 Apr. 2018, 1:00 pm Walter Bright via Digitalmars-d, < > digitalmars-d@puremagic.com> wrote: > >> On 4/8/2012 7:29 AM, Andrei Alexandrescu wrote: >> > On 4/8/12 1:33 AM, Daniel Murphy wrote: >> >> - Would generate false pointers >> > Fair point but we're also moving to precise collection :o). >> >> >> I don't know of a good generic way to do precise collection with unions. >> > > I wonder if precise collectors could leverage runtime support for > ambiguous cases? opPreciseCollect() which might return an array of pointers > contained in T, which would allow runtime logic to determine how the union > should be interpreted... Or maybe the function should receive a delegate > which the function should call on each embedded pointer. > > I'm sure some standardised runtime support function can help out in these > cases... >
This would be useful too for applications that use bit-packed or encoded/implied pointers... >