How to implement this?
    Elvis Zhou 
    elvis.x.zhou at gmail.com
       
    Fri Apr  8 05:53:03 UTC 2022
    
    
  
On Friday, 8 April 2022 at 05:46:56 UTC, Elvis Zhou wrote:
> On Friday, 8 April 2022 at 04:31:45 UTC, Elvis Zhou wrote:
>> [...]
>
> I know where the issue comes from, dynamic array is GCed and 
> save the reference of a local variable in GCed memory is not 
> allowed, but here structs is assumed to not escape, it can be 
> simply achieved by using a fixed-size array instead, ie A*[32] 
> structs; int i = 0; structs[i++] = cast(A*)&b; However I wonder 
> if there be a stack allocated array with max capacity limits, 
> which can be concated like with normal dynamic one.
like,
assumeNoEscapeOrWhatever!DynamicArray structs;
structs ~= cast(A*)&b;
is it possible?
    
    
More information about the Digitalmars-d-learn
mailing list