PS After reading your post I experimented with overloading shared/unshared methods in my code and came up with this solution:

shared Id!Service id ()() const if (is (typeof(this) == shared)) {
  return (cast(Service)this).id;
}
Id!Service id () const {
  return service_id;
}

I like this better than casting at the callsite (though it would be nice to roll those two into one method using a static if somehow, but I can't think of any way to do this).

Reply via email to