{"type":"rich","version":"1.0","url":"https://haru-s.hatenablog.com/entry/20100101/1262315115","description":"\u3051\u3069opEquals\u306fref const\u5f15\u6570\u3092\u8981\u6c42\u3057\u3066\u304f\u308b\uff0e import std.stdio; struct X { bool opEquals(ref const(X) x) const { return true; } } struct Y { X getX() const { return X(); } } void main() { X x; Y y; writeln(x == y.getX); // Error: y.getX() is not an lvalue } \u3057\u3087\u3046\u304c\u306a\u3044\u306e\u304b\u306a\u30fc\u3053\u308c\uff0e ref const(X) getX() const \u306b\u3059\u308c\u3070\u5927\u4e08\u592b\u306a\u306e\u3060\u304c\uff0e","blog_title":"...ing logging 4.0","provider_url":"https://hatena.blog","blog_url":"https://haru-s.hatenablog.com/","categories":["D\u8a00\u8a9e"],"author_url":"https://blog.hatena.ne.jp/haru-s/","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fharu-s.hatenablog.com%2Fentry%2F20100101%2F1262315115\" title=\"rvalue\u306fconst ref\u3067\u53d7\u3051\u53d6\u308c\u306a\u3044 - dmd 2.038 - ...ing logging 4.0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"haru-s","published":"2010-01-01 12:05:15","provider_name":"Hatena Blog","title":"rvalue\u306fconst ref\u3067\u53d7\u3051\u53d6\u308c\u306a\u3044 - dmd 2.038","width":"100%","image_url":null}