'typeof' question
DLearner
bmqazwsx123 at gmail.com
Tue Nov 28 19:36:26 UTC 2023
On Tuesday, 28 November 2023 at 18:43:37 UTC, Adam D Ruppe wrote:
> On Tuesday, 28 November 2023 at 18:41:49 UTC, DLearner wrote:
>> A* A_Ptr;
>>
>> struct B {
>> int BFld2;
>> typeof(A_Ptr)[0..($-1)] ASUB; // Idea is ASUB of type A,
>> from A_Ptr of type A*.
>
>
> I think what you really want is
>
> typeof(*A_Ptr) ASUB;
>
>
> the typeof thing returns the type you'd get from the code inside
Thanks - worked.
More information about the Digitalmars-d-learn
mailing list