On Thursday, 23 February 2017 at 09:57:09 UTC, ketmar wrote:
Arun Chandrasekaran wrote:
Is there an elegant way to achieve this in D?
why not static method or free function that returns struct? due to NRVO[0] it won't even be copied.

That's not elegant. You need a factory function for each type containing one of these structs then.
  • RAII Arun Chandrasekaran via Digitalmars-d-learn
    • Re: RAII ketmar via Digitalmars-d-learn
      • Re: RAII kinke via Digitalmars-d-learn
        • Re: RAII Adam D. Ruppe via Digitalmars-d-learn
      • Re: RAII Arun Chandrasekaran via Digitalmars-d-learn
        • Re: RAII ketmar via Digitalmars-d-learn
    • Re: RAII Adrian Matoga via Digitalmars-d-learn
    • Re: RAII cym13 via Digitalmars-d-learn
      • Re: RAII Arun Chandrasekaran via Digitalmars-d-learn

Reply via email to