First Draft: Implicit Conversion of Template Instantiations

Walter Bright newshound2 at digitalmars.com
Mon Mar 18 23:58:41 UTC 2024


On 3/17/2024 5:32 PM, Timon Gehr wrote:
> I think this is a bit dangerous. (And on stream you seemed to argue that this 
> has the potential to kill the proposal.)

I'm not convinced it is clean, nor am I convinced that it is dangerous. One 
solution would be simply to reject alias arguments that are functions. In 
general, the way may be to just keep rejecting things at compile time that 
aren't correct.

> I think the way to fix it would be to simply use a more strict standard than 
> "must belong to the same template". Add an opt-in annotation to template 
> parameters that indicates "this parameter may change in a const conversion". For 
> other parameters, you still require them to match by default.
> 
> This way, people can opt into the behavior.

I hear you, but I am concerned about yet another annotation.



More information about the dip.development mailing list