[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)

2015-06-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3089

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|2.030   |D2

--


[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)

2009-10-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3089



--- Comment #2 from Sobirari Muhomori dfj1es...@sneakemail.com 2009-10-28 
09:55:31 PDT ---
That's because struct has no monitor member, so the callee can't lock it for
exclusive access.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)

2009-10-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3089



--- Comment #4 from Jason House jason.james.ho...@gmail.com 2009-10-28 
10:55:53 PDT ---
(In reply to comment #3)
 To the best of my knowledge, currently, shared does not imply synchronized,
 though synchronized implies shared. Shared only provides the correct memory
 fences. Shared structs/arrays are important for lock-free algorithms.

That's the exact use case I want to do!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)

2009-10-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3089


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||WORKSFORME


--- Comment #5 from Walter Bright bugzi...@digitalmars.com 2009-10-28 
11:30:10 PDT ---
Works in dmd 2.035.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)

2009-08-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3089


Rob Jacques sandf...@jhu.edu changed:

   What|Removed |Added

 CC||sandf...@jhu.edu
 OS/Version|Linux   |All




--- Comment #1 from Rob Jacques sandf...@jhu.edu  2009-08-07 14:43:50 PDT ---
I've found const functions are callable on shared objects:

struct foo{
  int bar() const { return 1; }
}

void main(){
  shared foo f;
  auto x = f.bar;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---