Overloading const member function
kenji hara
k.hara.pg at gmail.com
Thu Jun 23 01:19:17 PDT 2011
This is definitely bug of current dmd.
It is already filed in bugzilla, see
http://d.puremagic.com/issues/show_bug.cgi?id=1983 .
Kenji
2011/6/23 Nub Public <nubpublic at gmail.com>:
> Why doesn't overloading of const member functions work?
>
> struct S {
> int a, b;
>
> int A() const { return a; }
> ref int A() { return a; }
>
> int min() const { return A() < b ? A() : b; }
> }
>
> DMD2 compiler error: S.A () is not callable using argument types () const
>
> Is it a bug or by design?
>
More information about the Digitalmars-d
mailing list