Is inc function part of the library ?

Alain De Vos devosalain at ymail.com
Thu May 13 12:56:49 UTC 2021


Writing an inc function is a fascinating voyage.
A function on module level did not worked because it had no this 
context.

This works:
```
void main(){
ref int inc2(ref int x) return pure nothrow @nogc @safe{
	++x;
	return x;
}
int x=0;
inc2(inc2(x));
writeln(x);	
```

The thing is i don't find the function pure.


More information about the Digitalmars-d-learn mailing list