http://dpaste.dzfl.pl/2a17662ce5b0
Doing completely separate implementation based on sharedness may be a bit more tricky. std.typecons.Proxy comes to my mind immediately but it does not allow proxying two objects with same method names.
At the same time it does not sound like a good idea to me. If I'd encounter code that magically picks totally different implementation based on shared qualified I'd call it a smart ass one and never accepted it through code review :) Such things really need to be explicit, magic is worst enemy of multi-threading
