digitalmars.D.bugs - [Issue 3720] New: Taking address of member functions possible without an instance
- d-bugmail puremagic.com Jan 18 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3720 Summary: Taking address of member functions possible without an instance Product: D Version: 2.039 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: tomeksowi gmail.com --- Comment #0 from Tomasz SowiĆski <tomeksowi gmail.com> 2010-01-18 15:04:35 PST --- struct S { int a; void fun() { this.a = 1; } } void main() { auto fp = &S.fun; fp(); } Outputs: object.Error: Access Violation The solution is either to delegalize it or (better) include the hidden parameter into the function pointer signature. So that &S.fun would be of type void function(ref S). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 18 2010








d-bugmail puremagic.com