Implicit conversion to mutable if no indirections?

Nick Treleaven nick at geany.org
Sat Sep 3 14:15:26 UTC 2022


On Saturday, 3 September 2022 at 01:50:05 UTC, Steven 
Schveighoffer wrote:
> It's not just that, there is no syntax to say to IFTI, "if you 
> match type T, I really want you to use type U". It would 
> actually be nice, but I don't know how it can be done.

The following works, the pragma only prints once.

```d
void f(T)(const T v)
{
	pragma(msg, T); // int
	T result;
	++result;
}

void main()
{
	const int c;
	f(c);
	f(int());
}
```


More information about the Digitalmars-d mailing list