C is Brittle D is Plastic

Patrick Schluter Patrick.Schluter at bbox.fr
Tue Apr 7 04:25:26 UTC 2026


On Sunday, 5 April 2026 at 10:28:42 UTC, Derek Fawcus wrote:
> On Sunday, 5 April 2026 at 00:15:33 UTC, Cid Lib wrote:
>>
>> Fixing 'pointer decay' with fat pointers is like upgrading the 
>> locks on your front door while the house is built on a 
>> shifting swamp.
>
> It has always been possible to avoid pointer decay for fixed 
> size buffers, it is just that that the syntax is ugly, and the 
> use cases are limited.

Indeed.

A function returning a pointer to an array of pointer is wild, 
for example:

      char *(*function_name(int param1, cons char *msg, ...))[20];





More information about the Digitalmars-d mailing list