[DIP idea] out variables

Jacob Carlborg doob at me.com
Sat Jan 30 07:27:16 UTC 2021


On 2021-01-27 19:25, Max Haughton wrote:

> Struct ABI can mean overhead in places you don't expect

If proper tuples are built-in to the language the language can invent 
its own ABI for that type. Just like it does for arrays and delegates.

On the other hand, there are a bunch of existing C functions that 
encodes out parameter as pointers. When declaring these in D, they can 
be declared with `out`, which will be more descriptive and safer than a 
pointer. It better shows the intent.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list