On Tuesday, 4 April 2017 at 12:05:15 UTC, Satoshi wrote:
Hi,
do someone have any experience with pImpl and inheritance in D?

Some parts of Phobos use it. Example: https://github.com/dlang/phobos/blob/master/std/stdio.d
Have a look at the struct ByLine

It has something like:

    struct ByLine(Char, Terminator)
    {
    private:
import std.typecons : RefCounted, RefCountedAutoInitialize;

        /* Ref-counting stops the source range's Impl
* from getting out of sync after the range is copied, e.g.
         * when accessing range.front, then using std.range.take,
         * then accessing range.front again. */
alias PImpl = RefCounted!(Impl, RefCountedAutoInitialize.no);
        PImpl impl;
  • pImpl in D Satoshi via Digitalmars-d
    • Re: pImpl in D Satoshi via Digitalmars-d
    • Re: pImpl in D Dejan Lekic via Digitalmars-d

Reply via email to