私はDに次のコードを持っています
import std.stdio;
class Thing
{
// Fields
private string Name;
// Accessors
public string name() { return Name; }
}
class Place: Thing
{
// Fields
private Place[string] Attached;
// Modifiers
public void attach(Place place) { Attached[place.name()] = place; }
public void detach(Place place) { Attached.remove[place.name()]; } // error line
}
dmd2.0でコンパイルしようとすると、次のエラーが発生します。
Error: function core.stdc.stdio.remove (in const(char*) filename) is not callable using argument types (Place[string])
Error: cannot implicitly convert expression (this.Attached) of type Place[string] to const(char*)
Error: remove((__error)) must be an array or pointer type, not int
現在のD2.0ドキュメントでは、実行しようとしていることにarray.remove [key]を使用するようにアドバイスされていますが、コンパイラはstd.c(stdc?)関数を呼び出そうとしていると考えているようです。なぜこれが発生するのでしょうか?これはdmd2.0の単なるバグですか?