|
Archives
D Programming
digitalmars.Ddigitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger D.gnu D C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.bugs - [Issue 3757] New: The overload and override issue of const/immutable member functions -2nd-
http://d.puremagic.com/issues/show_bug.cgi?id=3757 Summary: The overload and override issue of const/immutable member functions -2nd- Product: D Version: 2.040 Platform: Other OS/Version: Windows Status: NEW Keywords: spec Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: rayerd.wiz gmail.com Depends on: 3282 --- Comment #0 from Haruki Shigemori <rayerd.wiz gmail.com> 2010-01-30 19:30:03 PST --- import std.stdio; class Base { string f() { return "Base.f()"; } } class Derived : Base { string f() { return "Derived.f()"; } string f() const { return "Derived.f() const"; } } void main() { auto x = new Base; writeln(x.f()); auto y = new Derived; writeln(y.f());// calls "Derived.f() const", but it is expected that be called non-const. auto z = new const(Derived); writeln(z.f()); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- Jan 30 2010
|