D 2.0 FAQ on `shared`

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 21 16:19:43 PDT 2014


Am Tue, 21 Oct 2014 19:43:45 +0000
schrieb "Sean Kelly" <sean at invisibleduck.org>:

> On Tuesday, 21 October 2014 at 19:32:17 UTC, Marco Leise wrote:
> >
> > Do you think it would be bad if a pthread_mutex_t* was
> > declared as shared or only usable when shared ?
> 
> No.  But the issue in general concerns me.  Like say my class
> contains a C style FILE*.  If shared is transitive, then
> fprintf() must be modified to, what, take shared(FILE*)?  Maybe
> conditionally, since it won't always be shared?  I don't know
> that the shared equivalent of "const" is appropriate here either,
> since you'd pretty much stick it at the top of every module in
> core.stdc and core.sys.

No no, a FILE* is obviously immutable.

-- 
Marco



More information about the Digitalmars-d mailing list