Syntax: how to return shared?

Marek Janukowicz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 7 10:19:19 PDT 2015


How do I mark a function as returning shared object?

This won't compile:

shared Foo foo () {
  ...
}

This does, but looks somewhat awkward to me:

shared (shared Foo) foo () {
  ...
}

-- 
Marek Janukowicz


More information about the Digitalmars-d-learn mailing list