http://d.puremagic.com/issues/show_bug.cgi?id=4070
Summary: prefix const on member functions considered confusing Product: D Version: 2.041 Platform: Other OS/Version: Windows Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: simen.kja...@gmail.com --- Comment #0 from Simen Kjaeraas <simen.kja...@gmail.com> 2010-04-05 10:26:45 PDT --- struct foo { const foo* bar( ) const { return new foo; } } This function does not return a const foo, as one might expect. Rather, it is twice specified that this function does not change any members of foo. This is troublesome because, everywhere but in a function declaration, const foo* would be equivalent to const( foo* ). It is hence a source of confusion and inconsistency. If this is a case of unfortunate C++ inheritance, please make const foo bar( ) an error, and enforce the use of parentheses. If not, get rid of it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------