Problem with taking inout, const references

Uranuz neuranuz at gmail.com
Wed Mar 26 01:21:35 PDT 2014


If inout is treated as const does it mean that in this operator I 
can't assign new value to cookie object. In this case it means 
that I still should make separate class method with the same body 
to woraround this. I think that it's a bug. Am I right?

> 	void opIndexAssign(string value, string name)
> 	{	auto cookie = name in this;
> 		if( cookie is null )
> 			_cookies ~= Cookie(name, value);
> 		else
> 			cookie.value = value;
> 	}


More information about the Digitalmars-d-learn mailing list