On Thursday, October 10, 2013 11:28:02 Walter Bright wrote:
> On 10/10/2013 10:54 AM, Andrei Alexandrescu wrote:
> > On 10/10/13 12:18 AM, Walter Bright wrote:
> >> 1. Shared data cannot be passed to regular functions.
> > 
> > I don't understand this. If a function/method accepts "shared", then it
> > can be passed shared data.
> 
> I meant regular functions as in they are not typed as taking shared
> arguments. Shared cannot be implicitly cast to unshared. I say regular
> because very, very few functions are typed as accepting shared arguments.

Yeah. The only times that something is going to accept shared is when it was 
specifically designed to work as shared (which most code isn't), or if it's 
templated and the template happens to work with shared. Regular functions just 
aren't going to work with shared without casting away shared, because that 
would usually mean either templating everything or duplicating functions all 
over the place.

- Jonathan M Davis

Reply via email to