First Draft: Implicit Type Template Instantiation via Constructors

jmh530 john.michael.hall at gmail.com
Wed May 14 17:42:04 UTC 2025


On Wednesday, 14 May 2025 at 16:41:44 UTC, Sebastiaan Koppe wrote:
> [snip]
>> That is not actually a constructor - it is struct literal 
>> syntax. I did not realize there was a difference either until 
>> recently.
>
> Fair enough, but could the dip support it, or perhaps in the 
> future? The fact that we both expected it was a constructor - 
> and you could argue it actually is, on the grounds that it does 
> in fact construct an object - suggests more users would expect 
> it to work.

Struct literal syntax only works if there are no constructors. So 
at (current) step 4, you would want to check if there are no 
constructors. But then it might be a little more complicated to 
actually handle that case.


More information about the dip.development mailing list